I need
http://<hostname>/<album-name>/<photo-name-without-extension>
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
Comments
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).
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?
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)
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.
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.
`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.
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.
`
RewriteRule ^(.*)\.jpg\.php$ - [S=1]
RewriteRule ^(album1|album2)/(.*)$ $1/$2.jpg.php? [NC,R=301,L]
`
Hope that works.
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]