![]() |
|
rewrite clean url - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: rewrite clean url (/thread-12659.html) |
rewrite clean url - barisistanbul - 2017-02-07 I need rewrite clean url - acrylian - 2017-02-07 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 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 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 rewrite clean url - barisistanbul - 2017-02-07 Hi acrylian, 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.jpgbut when I want to reach it does not work although there is symlink file to real image. Can I solve this? rewrite clean url - acrylian - 2017-02-07 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 rewrite clean url - barisistanbul - 2017-02-07 I need to redirect to Thanks. rewrite clean url - acrylian - 2017-02-07 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. rewrite clean url - MarkRH - 2017-02-08 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:
This is placed above Zenphoto's stuff. rewrite clean url - barisistanbul - 2017-02-08 Thanks for all reply. If I remove the last / char ( (.)/$ -> (.)$ ) it loops. It works for 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. rewrite clean url - MarkRH - 2017-02-09 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.
rewrite clean url - barisistanbul - 2017-02-09 Thanks MarkRH, 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] rewrite clean url - MarkRH - 2017-02-09 Whatever gets the job done. |