Hi, I've got a lot of spidered and indexed content from an old CMS that starts index2.php?blah=blah&blah=blah&blah=blah I want to send anything hitting this to the front page, without the query string. I'm crap at mod_rewrite, so I need a hand, currently, I've got the line: RewriteRule ^(index2.php?.*)$ / [R=301,L] and I've tried RewriteRule ^(index2.php.*)$ / [R=301,L] Any ideas, these just redirect to /?blah=blah&blah=blah&blah=blah but I just want it to go to / Cheers, Chris
I think that you can strip an existing query string from a redirect by using a ? at the end, i.e RewriteCond %{REQUEST_URI} ^index2.php RewriteRule ^(.*)$ /? [R=301,L] cheers johnt
Thanks, but that didn't seem to work... or indeed match anything. Guess I should read the mod_rewrite docs one day
Sorry, the RewriteCond should have a / in it RewriteCond %{REQUEST_URI} ^/index2.php RewriteRule ^(.*)$ /? [R=301,L]