: Redirecting previous domain subfolder links I've recently bought a domain that was unregistered. After looking in Google webmaster tools, Google is trying to crawl random pages that don't exist.
I've recently bought a domain that was unregistered. After looking in Google webmaster tools, Google is trying to crawl random pages that don't exist. Turns out it did have a previous owner.
The offending pages are in the style
mysite.com/catalog/?Brand=0&Model=102&ID=0
Although there doesn't seem to be any links on the web (who knows what the previous owner did) I want these to point to my homepage.
I've tried redirecting using..
redirect 301 /catalog/ mysite.com/
but I end up with a redirect to my homepage with an URL in the address bar of...
mysite.com/?Brand=0&Model=102&ID=0
How do I get it to just redirect to my homepage and show URL mysite.com in the address bar with no gubbings on the end?
I am on an Apache server with PHP 5
Thanks.
More posts by @Pierce454
1 Comments
Sorted by latest first Latest Oldest Best
Simply append a ? to the end of the domain in the redirect rule to prevent the query string from being append to the final redirected url.
RewriteRule ^catalog/.*$ www.mydomain.com? [R=301,L]
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.