G2 -> G3 URL rewrite rules?
snackmaster
![]()
Joined: 2005-11-20
Posts: 135 |
![]() |
I'm following my 404s after upgrading to G3 RC1 and I'm trying to figure out how to redirect all .jpg.html pages to the top level of my new gallery. I would work to strip the .jpg.html "extension" from G2 and redirect requests 1-1 but not all my new URLs use the filename. I'm trying things like this in my .htaccess, without success: Any ideas? |
|
nivekiam
![]()
Joined: 2002-12-10
Posts: 16504 |
![]() |
snackmaster
![]()
Joined: 2005-11-20
Posts: 135 |
![]() |
Thanks, I had issues during the G2 import process did not get the rules written down or into my .htaccess during my second shot at upgrading. |
|
nivekiam
![]()
Joined: 2002-12-10
Posts: 16504 |
![]() |
To get settings just for your setup, go to Admin > Settings > Gallery 2 Import The bottom of the page will contain those. If not here are mine: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /gallery2/ RewriteRule ^(.*)$ /gallery3/g2/map?path=$1 [QSA,L,R=301] </IfModule>
Change the 2 directories in bold to match your setup. I've only installed G3 as a test so far and haven't replaced a G2 install with it in the same place yet. |
|
snackmaster
![]()
Joined: 2005-11-20
Posts: 135 |
![]() |
Thanks! ...as I have nothing below the file import path area on my G2 import page. I do recall it coming up during import and i copied for safe keeping but then due to import issues my priorities and focus changed |
|
snackmaster
![]()
Joined: 2005-11-20
Posts: 135 |
![]() |
Quote:
<IfModule mod_rewrite.c> Hmm playing with it and not working, my G3 install doesn't have a /g2/ folder in the path. I've tried |
|
nivekiam
![]()
Joined: 2002-12-10
Posts: 16504 |
![]() |
snackmaster
![]()
Joined: 2005-11-20
Posts: 135 |
![]() |
Ah! My old G2 location is gone.... I'll rebuild the structure. |
|
nivekiam
![]()
Joined: 2002-12-10
Posts: 16504 |
![]() |
No need to rebuild the structure. Just need to create that old gallery2 directory and an .htaccess file, then put those rewrite rules in that location. That would explain why you probably didn't see those rules anymore, because the G2 Import module in G3 couldn't find embed.php for your G2 install ____________________________________________ |
|
snackmaster
![]()
Joined: 2005-11-20
Posts: 135 |
![]() |
Still struggling with this, both old and new Gallery's were in the same directory /gallery/ and I end up in an endless loop: RewriteBase /gallery/ RewriteRule ^(.*)$ /gallery/g2/map?path=$1 [QSA,L,R=301]
Since the path to my images are the same in G3 with G2 I'm trying to trim the old extension: .jpg.html RewriteCond %{THE_REQUEST} ^GET\ /[^?\s]+\.jpg.html RewriteRule (.*)\.jpg.html$ /$1/ [L,R=301]
I'm no good at .htaccess |
|
snackmaster
![]()
Joined: 2005-11-20
Posts: 135 |
![]() |
Got it, had to add /gallery/ to the 4th line /gallery/$1/ <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /gallery RewriteCond %{THE_REQUEST} ^GET\ /[^?\s]+\.jpg.html RewriteRule (.*)\.jpg.html$ /gallery/$1/ [L,R=301] </IfModule>
and for files I renamed with G3 |
|
simmons
Joined: 2009-11-15
Posts: 7 |
![]() |
same problem as above. http://www.modelingtime.com/galleria/d/16643-3/CIMG4526.JPG to http://www.modelingtime.com/gallery/var/albums/aerei/Bonovox/CIMG4526.JPG?m=1293369936 can you help me?? |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
@simmons: the same advice for snackmaster should work for you. |
|
Whiskerfish
Joined: 2009-06-08
Posts: 15 |
![]() |
Sorry guys I know this might be a basic or even stupid question but my Current Gallery 2 htaccess has a redirect from Gallery 1. Should I clear that out first or add in the new redirect above it? |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
Hm. I can't remember what the G1->G2 redirects look like! I'd try leaving them both in place and see if it works.. if it does, theoretically it'd redirect G1 urls -> G2 urls -> G3 urls and it'd be ok. |
|