Reputation: 170
Recently we have released a new website for a company but some of the old links still apear on google webmaster tools.
I tried to create a redirect with some luck, however I want to fully remove the parameter and redirect all the links matching the structure to the new homepage.
So these pages
http://www.example.com/job/view.php?id=142
http://www.example.com/job/view.php?id=3453
http://www.example.com/job/view.php?id=567
will redirect to
http://www.example.com
I used this redirect
RedirectMatch 301 /job/view.php$ http://www.example.com/
which works OK with the exception that the resulting website looks like:
http://www.example.com/?id=142
Upvotes: 2
Views: 132
Reputation: 19016
You can try this way
RewriteEngine on
RewriteRule ^job/view\.php$ http://www.example.com/? [R=301,L]
Upvotes: 2