rss
twitter
    Find out what I'm doing, Follow Me :)

Friday, January 22, 2010

Pin It

Widgets

Restrict access to Magento during upgrades etc

We get many requests about how to restrict access to Magento during upgrades or other issues that requires that Magento is not available for customers and search spiders, but is still accessible for you to debug.

Here is an example of restricting your Magento instance to your IP address exclusively. Other visitors, including search spiders, will get the HTTP503 Service Unavailable error.

First, create a file 503.php in your Magento installation root:

      <?php
      header(‘HTTP/1.1 503 Service Unavailable’);
  
      header(‘Content-Type: text/plain; charset=UTF-8');
  
      echo "503 Service Unavailable";
      ?>

In .htaccess or in Apache server configuration, add the following rewrite rule:

Where 127.0.0.1 (note the backslashes before dots) should be replaced with your IP-address (check www.whatsmyip.com to find your IP.

Once you save this .htaccess file or reload Apache configuration, your site will be down until you restore the initial state.

Source : http://www.silverthemes.com/blog/2010/01/restrict-access-to-magento-during-upgrades-etc/

No comments:

Post a Comment