Thu. May 15th, 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

 

 

May 2025
M T W T F S S
« Jun    
 1234
567891011
12131415161718
19202122232425
262728293031