All web sites need a little tender loving care from time-to-time and this occurs it is good practice to redirect your site to a maintenance page which can explain why the site is down and when it will be back on line.

Step 1

Create a maintenance page. For this example I have uses /maintenance.html and placed it in the root directory

Step 2

Add the following code to your .HTACCESS file and as soon as you publish it the site will redirect to your maintenance page.

RewriteEngine on
RewriteCond %{REQUEST_URI} !/maintenance.html$
RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.123
RewriteRule $ /maintenance.html


This uses a 302 redirect preventing the search engines from indexing the maintenance page.