Redirect with .htaccess

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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  

I've tried a couple of things, but it's not working.

The bad URLs look like this:

That should redirect to:

This one doesn't work at all:
^search\.php\?mode=search&narrow_cat=[0-9]&term=([A-Z][a-z]+),%20([A-Z][a-z]+)&page=1$ /$2_$1 [R=301,NC,L]

This one works, except it doesn't include the "Hello" and the "World", only  
the underscore:

RewriteCond %  
RewriteRule ^search\.php /$2_$1 [R=301,NC,L]

Any ideas?  

Re: Redirect with .htaccess

Quoted text here. Click to load it

Just use a robots.txt to tell googlebot not to index the wrong page. And  
also go ask the Apache questions in an apache group, this is c.l.php...

"Ohjelmoija  on  organismi  joka  muuttaa  kofeiinia  koodiksi" - lpk - Satunnaisesti pivittyv nettisarjis | rot13(xvzzb@bhgbyrzcv.arg)  

Re: Redirect with .htaccess

Quoted text here. Click to load it

Sorry, I didn't know about the Apache group.

Robots.txt isn't as good as a redirect since it abandons the PageRank of the  
indexed versions.

I found an answer: use %1 and %2 instead of $1 and $2.

Site Timeline