redirect deleted album not working

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

  • acrylian Administrator, Developer
    Cannot really tell why it might have stopped working. Something like this should work, too:

    `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.
  • Hi,

    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
  • acrylian Administrator, Developer
    Where exactly did you put your redirection? It probably needs to be right after the rewriteBase command.

    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.
  • Hi,
    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>
  • acrylian Administrator, Developer
    Try removing the "gallery" in the first url as that is defined in the rewrite base already. Also the quotes for sure are not needed on the 2nd. Sorry, I am no real htaccess expert.
  • Do not be sorry acrylain! You have been more than helpful.
    I was able to fix the link, but again all albums now became unacessible except the index page.
    Any idea ?
    thanks
  • acrylian Administrator, Developer
    No idea but if this http://www.cayocococuba.net/gallery/ is the site it seems to work normally to me.
  • Yes, it works normally now, because I removed the redirection.
    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.
  • Hi,
    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!
  • acrylian Administrator, Developer
    Glad you figured it out! I suspected it might have been the "gallery" in the first part of the rules.
Sign In or Register to comment.