|
Posted by mobile_1 on 11/28/06 19:30
I am trying to fix a problem where Google has indexed the wrong version of a
URL. I need to redirect the bad version to the good version with 301
redirects.
I've tried a couple of things, but it's not working.
The bad URLs look like this:
/search.php?mode=search&narrow_cat=2&term=World,%20Hello&page=1
That should redirect to:
/dir/Hello_World
This one doesn't work at all:
RewriteRule
^search\.php\?mode=search&narrow_cat=[0-9]{1,2}&term=([A-Z]{1}[a-z]+),%20([A-Z]{1}[a-z]+)&page=1$
http://www.example.com/dir/$2_$1 [R=301,NC,L]
This one works, except it doesn't include the "Hello" and the "World", only
the underscore:
RewriteCond %{QUERY_STRING}
mode=search&narrow_cat=[0-9]{1,2}&term=([A-Z]{1}[a-z]+),%20([A-Z]{1}[a-z]+)&page=1$
RewriteRule ^search\.php http://www.example.com/dir/$2_$1 [R=301,NC,L]
Any ideas?
Navigation:
[Reply to this message]
|