Gallery 2 URLs that are rewritten by Gallery 3 cause a redirect loop

multiverse

Joined: 2005-05-06
Posts: 4
Posted: Thu, 2014-05-08 02:07

Hello,

PROBLEM: Gallery 2 URLs that are rewritten by Gallery 3 cause a redirect loop when .htaccess is in the tree that has been symlinked, and the .htaccess refers to the symlink.

Here is what I have done:

I used Gallery 2 at my website for several years. I couldn't get the final upgrade to complete successfully. I tried twice in 2 years. A few days ago I decided to see if an upgrade path to Gallery 3 had been sorted out, and here I am.

Typical Gallery2 URL
http://www.example.com/images/d/66977-4/example.gif

Typical Gallery 3 URL
www.example.com/images/var/albums/misc/album73/currentsg/example.gif?m=1399281315

As you can see the URLs are different, and my HTML img tags are no longer working, the effect being that images in the old hive do not appear. I hope you noticed in the URLs above this segment: /images/

Here is what it looks like on the *nix filesystem at Dreamhost:

images -> Gallery.3.0.9/
Gallery.2.3.1
Gallery.3.0.9

Please assume the permissions and owner/group are correct.

As you can see I use a symlink that allows me to roll back to Gallery 2. I use this method so that I can install a new version of Gallery 3 when one comes out. I used the same method for Gallery 2. This rub this time is that I need to do a redirect. I use the one that was presented by the Gallery 2 import tool found in the Gallery 3 settings:

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

I added this section to the bottom of $G3_HOME:/images/.htaccess - and here is that file in its entirety: http://pastebin.com/QnMFRgv2

Using the typical Gallery2 URL: http://www.example.com/images/d/66977-4/example.gif

The loop manifests itself in the browser:

An examination of $G3_HOME/images/var/logs/2014-05-07.log.php gives no clues, just that it's basically empty.

An examination of my error.log reveals something totally expected:

Quote:
File does not exist: $G3_HOME/images/d

No surprise, after all, this is what we are trying to fix.

An examination of my access.log reveals pretty much what the browser saw:

Quote:
GET /images/index.php/g2/map?path=index.php/g2/map&path=index.php/g2/map&path=index.php/g2/map&path=index.php/g2/map&path=index.php/g2/map&path=index.php/g2/map&path=index.php/g2/map&path=index.php/g2/map&path=index.php/g2/map&path=index.php/g2/map&path=index.php/g2/map&path=index.php/g2/map&path=index.php/g2/map&path=main.php&g2_view=core.DownloadItem&g2_itemId=71179&g2_serialNumber=2

I am using PHP 5.3.17 and Gallery 3.0.9. The directives used in .htaccess have been enabled by my provider.

So to restate the problem: Gallery 2 URLs that are rewritten by Gallery 3 cause a redirect loop when .htaccess is in the tree that has been symlinked, and the .htaccess refers to the symlink.

Thank you!

 
multiverse

Joined: 2005-05-06
Posts: 4
Posted: Tue, 2014-05-13 03:39

Anyone willing to give this a go?