Redirect with .htaccess
- From: "mobile_1" <mobile_1@xxxxxxxxxxxxxx>
- Date: Tue, 28 Nov 2006 14:30:40 -0500
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?
.
- Prev by Date: Learn PHP 5.0 with interactive tutorials at www.tutorialsdirect.com
- Next by Date: Re: php form help
- Previous by thread: Learn PHP 5.0 with interactive tutorials at www.tutorialsdirect.com
- Next by thread: padding with spaces
- Index(es):
Relevant Pages
|