Tips: Hide a Magento Test Site

Posted on: October 12th, 2009 by Ben Bishop 9 Comments

With every Magento e-commerce website I create for my clients, I create a carbon copy for use as a test environment that is accessible on the web.

There are a number of benefits associated with doing this before making changes on a live environment:

  • The ability to upgrade on the test server as updates become available.
  • Test extensions from Magento Connect.
  • Developing, testing and implementing new features.
  • Get sign off from the client while still in a test environment.

I can then quite easily and efficiently role out these enhancements without fear of complication.

What is vital though is that search engines don’t crawl and index the test environments. This can be done quite easily from within the Magento Dashboard.

Navigate to Configuration -> Design -> HTML Head and set the Default Robots option to ‘NOINDEX, NOFOLLOW’. This should add a ‘NOINDEX, NOFOLLOW’ meta tag to your site.

9 thoughts on “Tips: Hide a Magento Test Site

  1. cusious are you on the same server as the live sites? and using the live db? and once you get the sign off on upgrades do you copy files over to the live site or go through the process of magento connect again?

    • Sorry for the late response. This one slipped through the net.

      Same server, different database and unfortunately its a case of uploading the news files again (or Connect) to update the new site. Is there a more efficient way do you think?

  2. Thanks! This is a great, simple method to keep that test site out of the SERP’s. Here is another that I used that actually takes the site off the public Internet entirely (though as you mentioned you were doing work for clients, I can understand how this method is ideal for many as well):

    http://blog.nexcess.net/2011/03/18/using-the-hosts-file-test-your-magento-site/

    Cheers!

  3. Thx for the Tipp with nofollow.

  4. Pingback: Setup a Magento staging site « Magento Backstage

  5. Thanks, I couldn’t remember where the default robots option was! Also, if it helps anyone, I had forgotten to turn on “no index, no follow” on my test site and somehow it got picked up by Google. One way I dealt with it was to implement the following in my htaccess file, at the root of my test site:

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} .*gooo?gle.* [OR]
    RewriteCond %{HTTP_REFERER} .*ask.* [OR]
    RewriteCond %{HTTP_REFERER} .*yahoo.* [OR]
    RewriteCond %{HTTP_REFERER} .*excite.* [OR]
    RewriteCond %{HTTP_REFERER} .*altavista.* [OR]
    RewriteCond %{HTTP_REFERER} .*msn.* [OR]
    RewriteCond %{HTTP_REFERER} .*netscape.* [OR]
    RewriteCond %{HTTP_REFERER} .*aol.* [OR]
    RewriteCond %{HTTP_REFERER} .*hotbot.* [OR]
    RewriteCond %{HTTP_REFERER} .*goto.* [OR]
    RewriteCond %{HTTP_REFERER} .*infoseek.* [OR]
    RewriteCond %{HTTP_REFERER} .*mamma.* [OR]
    RewriteCond %{HTTP_REFERER} .*alltheweb.* [OR]
    RewriteCond %{HTTP_REFERER} .*lycos.* [OR]
    RewriteCond %{HTTP_REFERER} .*search.* [OR]
    RewriteCond %{HTTP_REFERER} .*metacrawler.* [OR]
    RewriteCond %{HTTP_REFERER} .*bing.* [OR]
    RewriteCond %{HTTP_REFERER} .*dogpile.*
    RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]

    It will basically redirect all the search engine traffic to your test site to the same URL on your production site. Example: http://test.yourwebsite.com/page.html will be redirected, if accessed from a search engine, to http://www.yoursite.com/page.html.
    Hope this will help someone!
    Cyril

  6. Excellent tips, both Ben’s on setting “NOINDEX,NOFOLLOW”, and Cyril’s great tip in how to redirect all search engine traffic to my test site to the URL of my new live site. I also didn’t know about “NOINDEX”, so search engines have been listing my development site!
    Thank you very much for your valuable help.

Leave a Reply

Your email address will not be published. Required fields are marked *