Redirect Problem Using REQUEST_URI

Discuss practical ways rearrange URLs using mod_rewrite.

Redirect Problem Using REQUEST_URI

Postby sharingsunshine » Mon Apr 26, 2010 11:42 am

I have tried to pattern match this kind of url with several attempts but I seem to be missing something. Please help me to figure this out because I have over a thousand urls that need this kind of change.

http:///www.domain.com/foo2.3/v/album_name/subalbum_name/pages.php?pageid=17 [This is the example URL and the subalbum_name will change]

Code: Select all
RewriteCond %{QUERY_STRING} ^pageid=([0-9]+) [NC]
RewriteCond %{REQUEST_URI} ^foo2.3/v/album_name/(.+)/pages.php [NC]
RewriteRule ^.+$ /foo2.3/v/album_name/$1/? [R=301,L]

OR

RewriteCond %{QUERY_STRING} ^pageid=([0-9]+) [NC]
RewriteRule ^foo2.3/v/bluebirdcove/(.+)/pages.php$ /gallery2.3/v/bluebirdcove/$1  [R=301,L]


Any help will be great.

Randal
sharingsunshine
 
Posts: 55
Joined: Tue Dec 19, 2006 5:32 am

Re: Redirect Problem Using REQUEST_URI

Postby sharingsunshine » Tue Apr 27, 2010 5:38 am

Does anyone have a different way to do it?
sharingsunshine
 
Posts: 55
Joined: Tue Dec 19, 2006 5:32 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: Google [Bot] and 16 guests

cron