Lock your site down for maintenance

This article explains how you can lock your site down for maintenance so that it is not publicly visible.

  1. Create a blank file in your public_html directory. The file name should be .htaccess
  2. Put the following code lines in your .htaccess file and customize the highlighted text as appropriate:

    ErrorDocument 503 "Our website is temporarily closed for maintenance. It should reopen by 12/12/2012"
    RewriteEngine On
    # TO ALLOW YOURSELF TO VISIT THE SITE, CHANGE 111 222 333 444 TO YOUR IP ADDRESS.
    RewriteCond %{REMOTE_ADDR} !^111\.222\.333\.444$
    RewriteRule .* - [R=503,L]

  3. Save the file. Now only you should be able to access the file from your IP Address.
Note: If you have a dynamic IP Address which keeps changing, doing this may not be a very good idea. If you IP Address changes you will be locked out of your site.

Was this answer helpful?

 Print this Article

Powered by WHMCompleteSolution