How to enable magento store on maintenance mode

To Enable maintenance mode for magento 1.6 or less

• From the Admin Panel, select System > Configuration
• Select the Maintenance Mode tab in the left side panel in the General section.
• Expand the Maintenance Mode Options bar.
• Set Enable Maintenance Mode to Yes.
• From the Maintenance Mode Page drop-down menu, select 503 Service Unavailable.
• In the Whitelist field, enter the IP addresses that you want to exempt from being redirected to the maintenance mode splash page, if you would like to view your store, while working on it. Your IP address is shown below – simply fill it into the Whitelist.
• Once you’ve configured it, click [ Save Config ] to save these changes.
To Enable maintenance mode for magento 1.7


To enable your magento 1.7 store for maintenance mode just you need to create a new file on your root folder named “maintenance.flag” .
If you still want to use your site from specific ip address then just need to make few changes on index.php file and create an array on which ip address you want to access the site. By writing the code below here ‘xxx.xxx.xxx.xxx is your ip address
$ip = $_SERVER[‘REMOTE_ADDR’];

$allowed = array(‘xxx.xxx.xxx.xxx’,’xxx.xxx.xxx.xxx’);

then change the line
if (file_exists($maintenanceFile)) {
to
if (file_exists($maintenanceFile) && !in_array($ip, $allowed)) {
Now you will see site is accessible from your ip address and others are seeing as on maintenance mode.

Related posts:

The following two tabs change content below.

Chandra Shekhar

GCP Architect
Chandra Shekhar Pandey is Google certified Cloud engineer, I am Magento2 Trained developer. Having huge experience in designing cloud solution. I have around 12 years of experience with world enterprise IT companies and fortune 500 clients. During my architecture design I am always caring about high availability, fast performance and resilient system. From the programmer background I have huge experience in LAMP stack as well. Throughout my carrier I have worked on Retail, E-Learning, Video... Read More about Chandra Shekhar

Latest posts by Chandra Shekhar (see all)