Temporarily Disable A Web Site

The steps to follow to temporarily disable any web site are fairly straightforward, just not very obvious.

Basically what we are going to do is to set up a new folder on your hosting which will contain the code for the disabled version of our site and we'll then rename the folder containing the site to something else and rename the folder with our disabled site in its place. When we are ready to enable the site again we can rename the folders back.

Now you have a rough idea of how to do it, let's go through it step by step so you know exactly what to do.

  1. Create a new folder on your hosting to hold the code representing your disabled web site.
  2. Create a web page in that folder with the filename index.html which contains the content of the page you want everyone visiting your site to see while your site is disabled.
  3. Create a .htaccess file in the folder. This file just needs to contain one line of code that has in it ErrorDocument 404 http://www.example.com/ (where www.example.com is replaced with the domain you are about to disable). This file will ensure that any references to any page of your site will be redirected to the one web page that your disabled site will contain that has the message about your site being disabled.
  4. The last step to actually disable your web site is to rename the folder containing the actual site to something else and rename the folder you just created so that it is now in the place where the site is expected to be found. So if the original site is in folder A and the disabled site is folder B then you rename A to C and B to A.

Any links to any web page anywhere on your site will now be automatically redirected to the page giving the message that your site is disabled. Note that you will not want to leave the site disabled like this for any length of time as if you do it will affect your entries in the search engine results as when they next check your site all they will find is the one page with the disabled message.

To enable your site again iit is just a matter of renaming the folders back (A to B and then C to A) so as to put everything back the way it was. Presumably you'd have made all the necessary changes to your site and uploaded them to the appropriate folder prior to renaming the folders back so as to re-enable your site.

So you can see exactly what effect the above processing has, I have created a dummy disabled site at http://disabled.felgall.com/ so you can see what happens when you try to access different web pages within a site disabled using this method.

Of course, if the site is using a CMS that provides an option for disabling the site then you'd obviously use that option if you need to disable that site. as that will be even simpler than using the method described above.


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow