Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a domain with URL, lets say: http://www.xxxxstaging.com/abc.php?id=10 which is having a pretty good ranking for some keywords in google.

However, this is our staging website and due to some historical reason, it was exposed to public.

Now we have a production domain (the one we want to be publicly available), say: http://www.xxxxproduction.com/abc.php?id=10 which have exactly the same html output as xxxxstaging.com

Our question is, for the exactly same keyword search, it never appear in any page of google.

Is it possible for us to "switch" the ranking in google, either tell the robot that they are indeed the same website, or tell google to change it for us?

share|improve this question
Not an answer to your immediate question but, in the future, consider using hosts file entries (like domain.staging) and/or authentication on your staging instance to ensure that staging content never gets indexed. – danlefree Mar 14 '11 at 21:08

Use a 301 redirect:

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?xxxstaging\.com$ [NC]
RewriteRule ^(.*)$ http://www.xxxlive.com/$1 [R=301,L]

This will redirect users and the search engines to the new site and the proper pages as well. Search engines will also then associate the old URLs with the new URLs and eventually replace them in the search results.

share|improve this answer
+1 - ... but do that after you verify both domains at Google Webmaster Tools and initiate a Change of Address: google.com/support/webmasters/bin/answer.py?answer=83106 – danlefree Mar 14 '11 at 18:43
... and use a different domain for your staging environment, and add a robots.txt to your staging to prevent google from indexing it. – Sripathi Krishnan Mar 14 '11 at 18:44
Both pieces of advice are spot on – John Conde Mar 14 '11 at 18:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.