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


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/ http://mysite.com/

but I end up with a redirect to my homepage with an URL in the address bar of...


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


  • Unless you have actual visitors hitting those URL's (in which case a 301 redirect page might be useful), wouldn't it be better to just respond with a 404? Google will see that those pages don't exist anymore and eventually stop crawling them. Even if visitors are hitting those URL's I'd still recommend using a nice, helpful, informative 404 page over a potentially confusing redirect. – BigBagel Apr 16 '13 at 20:29
  • I didn't think of that. I though Google penalised sites with lots of 404 errors. – Adam Apr 17 '13 at 18:55
  • You won't be penalized for responding to a request for a non-existent page with a 404. In fact, that's exactly the point of a 404. Here are a couple useful links: 1, 2 – BigBagel Apr 18 '13 at 18:55
  • Thanks BigBagel, I was under the impression that 404 = bad site design and upkeep. Thanks for clearing it up. – Adam Apr 20 '13 at 10:25

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/.*$ http://www.mydomain.com? [R=301,L]
  • Amazing. Thank you for a quick reply that solved the problem! – Adam Apr 16 '13 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.