Thu. Jul 10th, 2025

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

1 min read

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.

 

74

 

 

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.

 

 

75

 

 

July 2025
M T W T F S S
« Jun    
 123456
78910111213
14151617181920
21222324252627
28293031