Question

I have 2 domains, a site is deployed on one of them while the other has no content and simply redirects to the one with stuff. Google is indexing both of them, showing the same content from the first domain in the search details.

Q: How can I prevent the one that redirects from showing up on the search results?

Is it just a matter of deploying a robot.txt on the domain that redirects?

Was it helpful?

Solution

According to Google...

Q: I have the same content available on two domains (example.com and example2.org). How do I let Google know that the two domains are the same site? A: Use a 301 redirect to direct traffic from the alternative domain (example2.org) to your preferred domain (example.com). This tells Google to always look for your content in one location, and is the best way to ensure that Google (and other search engines!) can crawl and index your site correctly. Ranking signals (such as PageRank or incoming links) will be passed appropriately across 301 redirects. If you're changing domains, read about some best practices for making the move.

Source

So I'm guessing you aren't doing a 301 or Google changed.

OTHER TIPS

If all you want is to stop Google from indexing your site you should use the following robots.txt file:

User-agent: *
Disallow: /

However, if you want to make sure the correct domain shows up in Google's results you should:

a) Use HTTP 301 Redirects

b) Specify your canonical

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top