Ok, so you have to bring the s …

Ok, so you have to bring the site down for maintenance, and display a nice “closed” sign on the site to visitors.
Using Apache this is easy.
1. Create a directory, maintenance in the document root of the web server. Inside there put a .htaccess file with the following:

<limit GET POST>
order allow,deny
allow from all
</limit>

Create an index.html in this directory with whatever message you want to display to the user.

2. Create a .htaccess file in the document root of your server:

<limit GET POST>
order deny,allow
deny from all
allow from MYIPADDRESS
</limit>

Change MYIPADDRESS to the IP of the machine you access your site from.

3. Add the following to your httpd.conf, preferably in the virtual host of the server you’re taking down:

ErrorDocument 403 /maintenance/index.html

While you’re there, put the same in for 404 too.

Restart Apache and voila! You’re site is now under maintenance! Don’t forget to undo the above when you want visitors to get into the site!

Leave a Reply

%d bloggers like this:

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close