If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

Magento. How to put the website in maintenance mode

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. How to put the website in maintenance mode, 2.7 out of 5 based on 3 ratings