Gallery2->Gallery3 URL Rewrite prefix
|
gunebakan
Joined: 2006-06-06
Posts: 5 |
Posted: Tue, 2012-01-17 11:05
|
|
Hi, Thanks, |
|
|
gunebakan
Joined: 2006-06-06
Posts: 5 |
Posted: Tue, 2012-01-17 11:05
|
|
Hi, Thanks, |
|
Posts: 1633
The import module should have automated the redirects for you.
It's a bit more complicated to do it by hand.
I'm not sure if you're saying that you want the "v/" added to each url, or if you just want the old urls to work (instead of generating error messages).
Assuming the latter, change the bottom section of the htaccess to:
For the download prefixes, that's where the import module is the best solution. I don't remember how the "/d/" urls are structured, so I can't really say much on that.
Posts: 5
Hi,
The issue I mention can be found at the FAQ: http://codex.gallery2.org/Gallery2:FAQ#My_Gallery_URLs_begin_with_.2Fv.2F_and_.2Fd.2F.2C_why.3F
import module did not handled my .htaccess file. My old rule was:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
RewriteCond %{REQUEST_URI} !/main\.php$
RewriteRule . - [L]
RewriteCond %{THE_REQUEST} /d/([0-9]+)-([0-9]+)/([^/?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/main\.php$
RewriteRule . /main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3 [QSA,L]
RewriteCond %{THE_REQUEST} /v/([^?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/main\.php$
RewriteRule . /main.php?g2_path=%1 [QSA,L]
</IfModule>
All of my url open like:
http://hede.com/v/1album
http://hede.com/v/2album
http://hede.com/v/3album
but now:
http://hede.com/1album
http://hede.com/2album
http://hede.com/3album
So I lose the pagerank.
Thanks
Barış Efe
Posts: 1633
1) Are you that the import module's htaccess files were put in the proper locations (see steps 4-9)? http://codex.gallery2.org/Gallery3:Modules:g2_import
2) Did you try adding the code that I listed above to the root htaccess file?
Posts: 5
Hi,
1) I tried but it gives 404 error page.
2) Yes
I actually find that
RewriteCond %{THE_REQUEST} /v/([^?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/index\.php$
RewriteRule ^v/(.*) $1 [QSA,L]
or with redirect
RewriteRule ^v/(.*) $1 [QSA,R,L]
is working but default links are without /v/
Barış
Posts: 1633
I'm a bit confused, but let's start from where you are now.
Are you saying that it works now?
If not and you just [b]want[/] the "/v/" added to the gallery urls, can't you install (move) the entire gallery in a folder (named "v")?
Posts: 5
Right now I am using gallery2 and url is:
http://hede.com/v/album1
I upgraded to gallery3 with g2_import and album1 url changed to:
http://hede.com/album1
There were "URL Rewrite Administration" page on gallery2:

Thanks
Posts: 1633
Sound like you WANT the "/v/"
Just move the entire Gallery into a folder called "v" and that will do it.