[SOLVED] G1 -> G2 rewrite problems when trying to migrate & move to separate G2 website.
ivan_bev
Joined: 2006-04-10
Posts: 14 |
Posted: Tue, 2007-01-16 19:08 |
I am having a problem when migrating from G1 to G2 with the URL rewrite of G1 URLs to G2 URLs. Any (useful ;) )suggestions gratefully accepted! It appears to be purely rewrite issues (rather than any other configuration). I am moving my website ( http://www.dreamtime.org/ ) to a new machine and, as part of the migration, I am trying to upgrade my photo gallery from G1 to G2. In addition I want to move it from it's current place of http://www.dreamtime.org/photos/ to something like http://photos.dreamtime.org/photos/ (with or without the trailing /photos - I'm as-yet undecided). I have G2 multisite running fine on the new machine (with G2 sites running for a few friends). I have copied the website across, including the albums et al from the old machine, created a G2 multisite installation for http://photos.dreamtime.org/photos/ and imported a single "simple" album .. the latest one ( http://www.dreamtime.org/photos/lgi-xmas-2006 ). This imported fine, and the import page mentioned adding 151 rewrite entries for the migration. I have added the rewrite command into the apache config for www.dreamtime.org on the new machine (DNS is not pointing at it) as specified in the instructions, but tweaked for a redirect to the new website: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d Rewritecond %{REQUEST_FILENAME} !gallery_remote2.php RewriteRule (.*)$ http://photos.dreamtime.org/photos/main.php?g2_controller=migrate.Redirect&g2_path=$1 [QSA] </IfModule>
I then add a suitable entry to my hosts file so it uses the new machine for http://www.dreamtime.org/ and try to access the old URL for the G1 gallery: This fails ... but what happens is that (according to the apache logs) the rewrite-rule appends the full path to the "short URL", which migrate.Redirect does not recognise, so it doesn't work: 81.168.23.219 - - [16/Jan/2007:17:55:57 +0000] "GET /main.php?g2_controller=migrate.Redirect&g2_path=/var/www/hosts/www.dreamtime.org/docs/photos/lgi-xmas-2006 HTTP/1.1" 404 206 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)" 0 photos.dreamtime.org (also, for some reason it removes the "/photos" at the beginning of the URL). For the sake of confirmation, I did some hacks with aliases etc so that I could access the photos.dreamtime.org gallery directory from www.dreamtime.org, and then used the normal rewrite command (with no external rewrite) and it *did* work (although I didn't bother to try to fix the missing images due to the change in URL). It obviously accessed it as www.dreamtime.org/whatever rather than rewriting it to http://photos.dreamtime.org/ I've tried to juggle various things in the rewrite rules but to no avail. I am surprised if I am the first to want to split out to a separate G2 site whilst having G1 -> G2 rewrites working :| Any suggestions on where to go from here? Thanks in advance Ivan NOTE:
G2 URL (optional): http://photos.dreamtime.org/photos/ |
|
Posts: 14
To be more explicit, I put the above rewrite stuff in a "location" block in apache's virtual-host config, a la:
which gave the above issues. I believe this is still valid (as I believe putting the same entry in a directory block would do the same thing.
To resolve the problem, I put it in the virtual-server context (ie outside a "location" or "directory" block) and the below worked for what I wanted
( http://www.dreamtime.org/photos/GALLERY1INSTALL -> http://photos.dreamtime.org/photos/GALLERY2INSTALL )
May I suggest that this gets documented somewhere? I can't imagine I'm the only person that will want to do a G1 -> G2 migration in combination with a server move.