My site can be accessed by either http://example.com or http://beta.example.com. The sub domain beta is the same site but a different version and I want users to be able to use the beta but any links gained on the beta domain I want the link juice to pass to the main domain. How can this be done?

2 Answers 2


Never treat Googlebot any different than actual site visitors

You should never treat Google bot any different from actual users. Redirecting Googlebot using user agent or other similar tactics and not users will likely harm your site as its against Google's guideline rules.

Cosmetic changes say hello to canonical links

If the beta site has the same content but different cosmetic changes through CSS then you should use canonical links pointing to the master pages that way any links gained on beta will pass to the main domain.

If the content is different

If the content is actually different then you should not attempt to redirect Juice as this again will not go well with Google, if you want the juice to flow to the main site then you should run it on the main domain with a sub folder /beta/.

  • I should add that if the sub-domain is not to be indexed, then you should have a robots.txt file that restricts indexing.
    – closetnoc
    Oct 28, 2014 at 22:09
  • @closetnoc If you block the subdomain with a robots.txt file then the pages won't be crawled, the rel="canonical" tag won't be seen and no "link juice" will be passed to the main domain. If the subdomain's pages have a noindex robots meta tag (or HTTP response header), then again I doubt they will pass "link juice". The canonical link (for same content pages) should prevent the beta pages from appearing in the SERPs, however, in order to (try to) pass "link juice" I think there will always be a chance that the beta pages could be indexed?
    – MrWhite
    Oct 28, 2014 at 23:28
  • @w3d Yes. You are right. It is a catch 22 but I think I would still block using robots.txt. It does not mean that the page with a link will not be crawled. It will be despite the robots.txt as a result of following the link but not indexed fully (unless something has changed recently). It would not be crawled under normal circumstances. Remember recently Google was spidering pages as a result of a link and placing the page in the index without a snippet due to robots.txt file? That is what I am referring to. I could be way off base though. Just a thought.
    – closetnoc
    Oct 28, 2014 at 23:36

The best way to do this is with a rel canonical link tag in the head of each of your pages.

So the home page of both your main site and your bet site would have this:

<link rel="canonical" href="http://example.com/" />

And foo.html on each would have this:

<link rel="canonical" href="http://example.com/foo.html" />

That way Google knows which is your preferred site. Google will also treat all inbound links to the beta site as if they pointed to the main site.

  • A caveat should be added, only use canonical tags if the content is the same, or very similar on both pages.
    – Max
    Oct 28, 2014 at 23:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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