Member
Member
barisistanbul   2017-02-07, 13:24
#1

I need
http:////
for my old external links (otherwise)
When I searched on forum photo.jpg has to have jpg extension on url because there could be another photo with png, gif etc.
Is there any way to hack this?
Or
I tried to put a symlink by 'ln -s photo.jpg photo' under albums directory but it does not worked for http://hostname/album/photo (without jpg extension).
Because I have many external links to my photos that I can not edit, I badly need it.
Thanks.
Baris

Administrator
Administrator
acrylian   2017-02-07, 14:49
#2

There are more reasons for the suffix besides that there can be a "png" of the same name as for example a "jpg". Internally Zenphoto needs the suffix because /something/somethingelse/ is also the url of a subalbum "somethingelse" of the album "something". So Zenphoto would not know what you actually want or has to check what exists and to use if it exists.

You could possibly use htaccess to rewrite but since ZP does this internally it would be probably quite inconvenient and complicated.

The best would be to redirect your old urls to the new ones. But given that the old structure is not really clear that would be a bit complicated. Unless you have only one album level like /something. Then you could redirect all /something/somethingelse urls to /something/somethingelse.suffix to get the actual Zenphoto ones.

Btw, it is not recommened to use single image page links with just the suffix as this can cause search engines to mistake the single image page for a direct image link. Therefore always .html or similar should be appended (the rewrite suffix as we call it).

Member
Member
barisistanbul   2017-02-07, 15:03
#3

Hi acrylian,
Thanks for the fast reply.

I have ~public_html/albums/myalbum/image linked to ~public_html/albums/myalbum/image.jpg

cd ~


cd public_html/albums/myalbum/


ln -s image image.jpg


but when I want to reach

http://hostname/myalbum/image

it does not work although there is symlink file to real image.

Can I solve this?

Administrator
Administrator
acrylian   2017-02-07, 16:56
#4

You mistake the single image page we are talking about with the actual image urls. Those are two different urls!

URL to the single image page http://www.example.com/albumname/imagename.jpg.html (.html is the rewrite suffix that can be changed via options and must not be an actual suffix, something like _view should work as well).
URL to the actual image http://www.example.com/albums/albumname/imagename.jpg ("albums" is the folder on the file system that is not part of the single image page)

Member
Member
barisistanbul   2017-02-07, 17:37
#5

I need to redirect to
http://www.example.com/albumname/imagename
to
http://www.example.com/albumname/imagename.jpg.html
whatever method I can.
Is there any solution for one image or many/all images including symlinks?

Thanks.

Administrator
Administrator
acrylian   2017-02-07, 17:50
#6

Problem is still that this conflicts with Zenphoto's own urls for albums since http://www.example.com/albumname/imagename is technically an album url for it. I fear you cannot generally redirect these since that would kill album urls for the first subalbum level.

If you know you have only this level and don't intend to use further subalbum levels you probably could do that within the root htaccess file before Zenphoto's own redirecting takes place.

I am not sure about what symlinks you mean. If you mean your old images you have to put all images Zenphoto is supposed to manage into the root "albums" folder anyway. If the server supports symlinks Zenphoto uses them for the resized image cache only. But that is not important here since you don't link to the images directly normally.

Member
Member
MarkRH   2017-02-08, 01:51
#7

When I moved from Gallery3 to Zenphoto I had to make several rewrite rules because the image pages in it ended with a "/". For example, here's one I made:

RewriteRule ^(misc-pics|my-vehicles|home-theater|cindy-crawford|danica-patrick|humorous|ibm-party|bass-pro-shop|planetary-society-and-seti|getglue-stickers|nature)/(.*)/$ $1/$2.jpg.php? [NC,R=301,L]

This is placed above Zenphoto's stuff.

Member
Member
barisistanbul   2017-02-08, 11:49
#8

Thanks for all reply.
MarkRH: That's what I want.

If I remove the last / char ( (.)/$ -> (.)$ ) it loops. It works for
http://hostname/album/photo/
But I need
http://hostname/album/photo

RewriteRule ^(misc-pics|my-vehicles|home-theater|cindy-crawford|danica-patrick|humorous|ibm-party|bass-pro-shop|planetary-society-and-seti|getglue-stickers|nature)/(.*)$ $1/$2.jpg.php? [NC,R=301,L]

Could you make last touch?

Thanks.

Member
Member
MarkRH   2017-02-09, 07:30
#9

Yeah, I see what you mean. When you take that last "/" out, it also winds up matching the re-written URL as well. You might try putting this above that rewrite to make it skip it. The S=# should be the number of following rules to skip. In this case I am skipping 1 rule.

RewriteRule ^(.*)\.jpg\.php$ - [S=1] RewriteRule ^(album1|album2)/(.*)$ $1/$2.jpg.php? [NC,R=301,L]
Hope that works.

Member
Member
barisistanbul   2017-02-09, 08:48
#10

Thanks MarkRH,
I found below code worked for me (noted here that someone may need it):

RewriteCond %{REQUEST_URI} !(.html|/|php|jpg)$


RewriteRule ^(antalya.|izmir.|photos.|istanbul.|isparta.|nevsehir.|image.|balikesir.|bursa.*|rize.


|canakkale.|edirne.|denizli.|mugla.|kirklareli.)/(.*)$ %{REQUEST_URI}.jpg.html [NC,R=301,L]

Member
Member
MarkRH   2017-02-09, 09:02
#11

Whatever gets the job done.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.