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 [R=302,L]

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

The following two tabs change content below.
After a long career in sales, marketing and engineering design, within the manufacturing sector, George launched Web Strategic Marketing in 2009 to enable businesses to be able to effectively compete in the new world of Internet and Social Media Marketing. With the ability to develop marketing plans and marketing strategies, web site development (HTML and WordPress), search engine optimization, social media marketing, write copy and shoot product/commercial photography Web Strategic Marketing is your one-stop-shop for your Internet marketing needs.