G2 to G3 url rewrite
Vanny
Joined: 2006-02-10
Posts: 8 |
Posted: Mon, 2014-02-10 20:19 |
I'm finally biting the bullet and trying to move away from G2 and into the considerably smoother, better looking and easier to manage G3. Installation of G3 was straight forward and i got it up and running quickly. Importing all the pictures from G2 was also straight forward using the G2 Import Mod, but i've become stuck! My URL rewrite doesn't work, and for the life of me i can't figure out why. I think the basics are checked, URL Rewrite code is at the top of the gallery2/.htaccess file (the g2 install is still present in its entirety), G2 Import is still switched on, and gives options in G3 settings. The rewrite is working, in that it is removing /gallery2/ and replacing it accordingly from any request, but it seems the G2 import module isn't interpreting the request correctly. I've tried to put as full a detail as I can below. Anyone have any ideas? ================================================================ Base URL JPG being called from Example old URL to JPG (from server log) Current URL REWRITE in gallery2/.htaccess gives Example of where the actual picture now is Gallery 2 embed.php is at G2 Import is turned ON in gallery and the suggested REWRITE code is <IfModule mod_rewrite.c> Current .htaccess looks like
## BEGIN Url Rewrite section RewriteBase /gallery2/ RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{THE_REQUEST} /gallery2/d/([0-9]+)-([0-9]+)/([^/?]+)(\?.|\ .) ## END Url Rewrite section Places looked for help Accessing Platform information Host name: Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux Gallery stats Version: 3.0.9 (Chartres) Kohana_404_Exception [ Page Not Found ]:The page you requested, g2/map?path=d/4626-3/Tap 44.jpg, could not be found. |
|
Posts: 1857
I didn't import from G2; I did fresh installs and re-uploaded everything (for other reasons). Having said that:
I don't think that's the way it's designed to work.
After you've successfully imported to G3, you copy the htaccess that import generates into the G3 htaccess file and then change the names so that G3 sits where G2 used to sit.
Check steps 6-8: http://codex.galleryproject.org/Gallery3:Modules:g2_import
=====
If, for some reason, you NEED to have a new directory for G3 than whatever you used for G2, you need to change the rewrite rules (not the conditions, though). So, for example, I think that
RewriteRule . /gallery2/main.php?g2_path=%1 [QSA,L]
would have to change, but I'd have to test and look at how the mapping works to be sure.Posts: 8
tempg, it seems to depend on which guide you read. You can either use a rewrite to redirect everything from the old dir to the new one, or rename the dirs so new becomes old.
I've tried both, at length. I did manage to get a small amount of success, but only as far as redirecting some specific images.
The top of my Gallery2/.htaccess file now looks like this
the G2_Import suggestion looks like this;
Ultimately no external links work now, so i'm thinking i might as well just save myself some grief and move away from the Gallery3 system and to something a bit better supported. I only use this gallery system to host my own pictures, not for other users, and while G3 takes away a lot of the faff of G2 administration, the two systems are too different to be fully compatible.
Posts: 1857
Ok. That works. I'm certainly don't want to put time into this if you're moving on.
Best of luck for whatever you end up using.