Magento In Maintenance Mode

So here is a little bit of code, that allows you and other you set to work on the site while everyone else sees its maintenance mode.

All we need to do it edit 3 lines.

Open: index.php in root and above line 57 add (remembering to edit the ‘allowed’ array to contain the IP’s you want to be able to access the site);
[php]
$ip = $_SERVER[‘REMOTE_ADDR’];
$allowed = array(‘182.186.0.134”); // IP’s that are allowed to view the site.

then change the line
if (file_exists($maintenanceFile)) {
to
if (file_exists($maintenanceFile) && !in_array($ip, $allowed)) {
[/php]
Simple. Now you can access the site, while others see its maintenance mode.

Leave a Comment

Your email address will not be published. Required fields are marked *

*