Categories

Featured templates

Magento. How to put the website in maintenance mode

Ryan DeWitt November 21, 2012
Rating: 2.8/5. From 5 votes.
Please wait...

This tutorial shows how to put Magento website in maintenance mode.

1. In order to put site to maintenance mode you should create empty maintenance.flag file and upload it to the root folder. After that your web site will look like on the screenshot.

2. Please note that even admin user can not access the site. In order to have access you should modify index.php file in Magento root folder and specify list of IPs that will have access to your site. Download and open original index.php file.
On line 47 put the following code:
$ip = $_SERVER['REMOTE_ADDR'];
$allowed = array('69.65.23.100','2.2.2.2');

In the $allowed = array(‘69.65.23.100′,’2.2.2.2’); you should specify list of IPs that will have access to your site.

3. Search the following code:
if (file_exists($maintenanceFile)) {

Replace it with

if (file_exists($maintenanceFile) && !in_array($ip, $allowed)) {

Look modified code you can see on the screenshot below.

4. Refresh your site. It should show up in case you put correct IP address.

5. In order to modify content of maintenance page you should edit errors/default/503.phtml file.

Feel free to check the detailed video tutorial below:

Magento. How to put the website in maintenance mode

Magento Premium Templates
This entry was posted in Magento Tutorials and tagged Magento, maintenance, mode. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket