G1 -> G2 imported just fine, G1 URL's don't work though...

jeepinjason

Joined: 2005-10-13
Posts: 5
Posted: Tue, 2007-05-01 03:57

I'm currently in the process of migrating one of my G1 installs to G2.2.1 and running into a bit of trouble. The install went smoothly, and the importing of all my G1 albums and images went smoothly. The problem is all my old G1 URLs are broken now; they're not redirecting to the new G2 pages. The G2 install is in the same directory that my G1 used to be in. I moved my G1 install to a new directory as per the migration instructions, then installed G2 under the directory G1 used to be in, then imported from my G1 install.

Yes, I've read: http://codex.gallery2.org/Gallery2:migration#Preserving_Gallery_1_URLs
I've got the Migration Module installed and activated, G1->G2 mapping is turned on, and I've got URL Rewrite activated ("There are 2169 G1->G2 map entries").

I've been staring at this stuff for 3 hours now trying to figure out why it's not working and for the life of me I can't figure it out... any help would be greatly appreciated.

Old/Original G1 install (used to be under /photos):
http://jeepin.net/g1/albums.php

New G2 install:
http://jeepin.net/photos/main.php

example non-working G1 URL: http://jeepin.net/photos/albums/more/100_2269.jpg

G2 can write to .htaccess just fine. Here's the contents of /photos/.htaccess:

=============================================
# BEGIN Url Rewrite section
# (Automatically generated. Do not edit this section)
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteBase /photos/

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
RewriteCond %{REQUEST_URI} !/photos/main\.php$
RewriteRule . - [L]

RewriteCond %{THE_REQUEST} /photos/d/([0-9]+)-([0-9]+)/([^/?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/photos/main\.php$
RewriteRule . /photos/main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3 [QSA,L]
RewriteCond %{THE_REQUEST} /photos/key/([^?/]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/photos/main\.php$
RewriteRule . /photos/main.php?g2_view=keyalbum.KeywordAlbum&g2_keyword=%1 [QSA,L]
RewriteCond %{THE_REQUEST} /photos/v/([^?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/photos/main\.php$
RewriteRule . /photos/main.php?g2_path=%1 [QSA,L]
RewriteCond %{THE_REQUEST} /photos/([^?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/photos/main\.php$
RewriteRule . /photos/main.php?g2_controller=migrate.Redirect&g2_path=%1 [QSA,L]
</IfModule>

# END Url Rewrite section
=============================================

Gallery version = 2.2.1 core 1.2.0.1
PHP version = 4.4.6 apache
Webserver = Apache
Database = mysqlt 4.1.21-standard-log, lock.system=flock
Toolkits = ArchiveUpload, Exif, ImageMagick
Acceleration = none, none
Operating system = Linux dalc1-cp02.ncserv.com 2.6.9-42.0.10.ELsmp #1 SMP Tue Feb 27 10:11:19 EST 2007 i686
Default theme = matrix
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Rows in GalleryAccessMap table = 8
Rows in GalleryAccessSubscriberMap table = 2170
Rows in GalleryUser table = 2
Rows in GalleryItem table = 2170
Rows in GalleryAlbumItem table = 34
Rows in GalleryCacheMap table = 0

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2007-05-01 15:33

you need to differentate between 2 things:
1. image URLs (URLs to the files)
2. photo / album page URLs (URLs of the HTML pages that contain the image URLs)

You've successfully enabled the G1->G2 redirection for #2. But you still need to enable redirection for #1.

create a albums/ folder in your photos/ folder and in there, create a .htaccess file and copy the contents shown in "site admin -> gallery1" to that 2nd .htaccess file.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
jeepinjason

Joined: 2005-10-13
Posts: 5
Posted: Tue, 2007-05-01 16:05

EXCELLENT! That did the trick. I figured it had to be something simple like that. I'd created the necessary .htaccess file already, it was just in the wrong directory: I had it under the albums/ directory in my G1 install (ie: g1/albums/) instead of under the G2 install. Once I created photos/albums/ and moved the .htaccess file there, it worked like a champ. And that also enabled redirects for the album URLs too.

Thank you very much.