During development we use a domain on a testserver. When development is complete we “push” our code to the livedomain (on liveserver). Development only occurs on testdomain.
During development we added Google Analytics to our code. Now Google indexed our developmentdomain and shows both the live and testdomain in the searchresults.
We only want our livedomain in Google Searchresults.
I read some documentation about 301-redirects. But is it the best way to fix this problem?
Developmentdomain: http://developer.example.com:81 (on testserver)
Live-domain: http://www.example.com (on liveserver)
Google respects robots.txt see: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=156449
You can add a robots.txt in the root of your domain with the content:
However, this will not solve your problem immediately, Google Bot will need to visit your site again.
Also, have a look at this: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=164734