Gallery 2 -> Gallery 3 In Situ Redirects

morganfeldon@gm...
morganfeldon@gmail.com's picture

Joined: 2009-06-22
Posts: 31
Posted: Tue, 2012-11-27 22:12

Apologies if this has already been posted, but I saw a lot of advice and threads about redirects from Gallery 2 to Gallery 3 if you plan to change the URL. Maybe I am the odd duck for wanting the old gallery and new gallery to be at the same URL with no /gallery/, /gallery3/, or any of that jazz after it.

After beating my head against the wall for a few hours, I came up with this. Hope it's helpful:

Quote:
RewriteEngine On
RewriteBase /
RewriteRule ^main.php(.*) /index.php/ [R=301,NC]
RewriteRule ^d/([^/]+)/([^/]+) index.php/g2/map?path=d/$1/$2 [R=301,NC]
RewriteRule ^v/([^/]+)/([^/]+).jpg(.*) /var/albums/$1/$2.jpg [R=301,NC]
RewriteRule ^v/([^/]+) /index.php/$1/ [R=301,NC]

This will redirect incoming links to albums, photo "pages", and the actual embedded photo to the corresponding links in Gallery 3. Add this to your .htaccess file.

 
habakuk

Joined: 2006-03-24
Posts: 28
Posted: Thu, 2013-08-08 20:43

This didn't work for me, I changed it to:

Quote:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^main.php(.*) /index.php/ [R=301,NC]
RewriteRule ^d/([^/]+)/([^/]+) index.php/g2/map?path=d/$1/$2 [R=301,NC]
RewriteRule ^v/(.*)$ /index.php/g2/map?path=v/$1 [QSA,L,R=301]
</IfModule>