This is a guide to show you how to create a simple maintenance page for your site.

It does the following:
  • Sends a 503 status code, which tells search engine spiders your site is still available, but to come back later because it's undergoing maintenance.
  • Displays a maintenance screen for all visitors to the site.
  • Displays the site normally for an IP address you specify.
Download the zip file, and extract maintenance.php to the base folder of your web site. This is usually the public_html folder.

Open the .htaccess file found in the base folder. If one does not exist, create it.

Add this at the top of the .htaccess file:

Code:
RewriteEngine On
RewriteCond maintmode  -f
RewriteCond %{REMOTE_ADDR}  ^xxx\.xxx\.xxx\.xxx
RewriteRule ^.*                  /maintenance.php [L]
Replace xxx\.xxx\.xxx\.xxx\. with your IP address. You can find it here:
What is my ip

If your IP address was 3.242.219.52 then the code in .htaccess would look like this:
Code:
RewriteEngine On
RewriteCond maintmode  -f
RewriteCond %{REMOTE_ADDR}  ^3\.242\.219\.52
RewriteRule ^.*                  /maintenance.php [L]

When you want the site to go into maintenance mode, create an empty file called maintmode in the same folder the .htaccess file is in. You can test this by change the IP address to a random set of numbers that isn't your IP, and then create the maintmode file.

To come out of maintenance mode, remove the maintmode file.

Download the zip file here: https://driven2services.com/attachments/maintenance-zip.62/