Hi,
I am used to redirect file from my server.
But there is something I do nmot understand about ZenPhoto.
In my GWT, there is 404 error message.
Yes this album no longer exist, but I cannot redirect to the proper album.
Here is the code I am using ...
RewriteEngine on
RewriteRule ^gallery/Sights/RestoLasDunas/$ "
http://www.cayocococuba.net/gallery/Sights/RestoLarga/" [R=301,L]
Usually it works, but not this time.
Any clue?
Thanks
Comments
`Redirect permanent /gallery/Sights/RestoLasDunas/ http://www.cayocococuba.net/gallery/Sights/RestoLarga/`
No real htaccess expert myself. Zenphoto does not do all rewriting/redirecting via htaccess anymore.
I have been doing few tests recently.
If I use this code (as I do regulary to prevent 404 error) in my .htaccess to redirect this 404 error link ..
RewriteRule ^gallery/Sights/DelfinarioCayoGuillermo/page/2/$ "http://www.cayocococuba.net/gallery/Sights/DelfinarioCayoGuillermo/" [R=301,L]
it will only works if I remove the content of the .htaccess in the main zenphoto folder.
BUT If I do so, then all the links from the index page generates a 404 error. Meaning that all albums that I see in the index page are no longer accessible.
My question is ... What is the purpose of the .htaccess in the zenphoto folder ? and how to change the content to allow standard redirection.
Thanks,
Normand
I don't exactly understand what the purpose of the exaple is as both is supposedly the same album? Or is the domain different?
The purpose of the htaccess is to do general rewriting (if you are on a Apache compatible host, nginx does not need it but other additions). The actual rewriting of urls like `&album=somealbum` to `/somealbum` is done internally.
I am converting my old coppermine to zenphoto.
I want all my new zenphoto to have the same configuration.
So, as I same the number of thumbnails to be displayed per page. It created a page2 that no longer exist, so this is why I created the redirection to remove the page2 link.
May be I did the redirection wrong. Here is the content of the .htaccess in the zenphoto folder ...
# htaccess file version 1.4.5;
# Rewrite rules are now handled by PHP code
# See the file "zenphoto-rewrite.txt" for the actual rules
#
# These rules redirect everything not directly accessing a file to the Zenphoto index.php script
#
<IfModule mod_autoindex.c>
IndexIgnore *
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /gallery
RewriteRule ^gallery/Sights/DelfinarioCayoGuillermo/page/2/$ "http://www.cayocococuba.net/gallery/Sights/DelfinarioCayoGuillermo/" [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]
RewriteRule ^.*/?$ index.php [L,QSA]
</IfModule>
I was able to fix the link, but again all albums now became unacessible except the index page.
Any idea ?
thanks
I do not know much about coding .htaccess, but I do not understand why if I try to redirect any links, it compromise the photoalbum ????? ZenPhoto is a great tool and I am now using this script to convert my old coppermine photoalbum.
This is my last modification of .htaccess and it works great ...
# htaccess file version 1.4.5;
# Rewrite rules are now handled by PHP code
# See the file "zenphoto-rewrite.txt" for the actual rules
#
# These rules redirect everything not directly accessing a file to the Zenphoto index.php script
#
<IfModule mod_autoindex.c>
IndexIgnore *
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On # last update: 2015-03-13
RewriteBase /gallery
RewriteRule ^Sights/BoatAdventure/page/2/$ "http://www.cayocococuba.net/gallery/Sights/BoatAdventure/" [R=301,L]
RewriteRule ^Sights/DelfinarioCayoGuillermo/page/2/$ "http://www.cayocococuba.net/gallery/Sights/DelfinarioCayoGuillermo/" [R=301,L]
RewriteRule ^Sights/RestoPilar/page/2/$ "http://www.cayocococuba.net/gallery/Sights/RestoPilar/" [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]
RewriteRule ^.*/?$ index.php [L,QSA]
</IfModule>
Many thanks for your help!