Thứ Ba, 21 tháng 1, 2014

How-to question about Magento maintenance mode

How-to question about Magento maintenance mode

When implementing significant changes to your Magento store, it is important to maintain ongoing communication with the customer. You can place your site in Magento maintenance mode whenever you need to perform maintenance on your site. In Magento Maintenance Mode, your visiors will see 503 Service Unavailable page by default until you return to production mode. Otherwise, you can also create a custom page for your customers to see during maintenance. magento maintenance mode  

 In this tutorial, you’ll learn how to enableMagento Maintenance Mode, how to limit the scope of  Magento Maintenance Mode, customize the page that your customers see while in Magento Maintenance Mode, and retain access to your Magento Admin Panel.

Magento Maintenance Mode Magento Maintenance Mode Magento Maintenance Mode Magento Maintenance Mode Magento Maintenance Mode Magento Maintenance Mode Magento Maintenance Mode Magento Maintenance Mode Magento Maintenance Mode Magento Maintenance Mode
How to active Magento maintenance mode?
1. Normally, in order to activate Magento maintenance Mode you should create empty maintenance.flag file and upload it to the root folder. Its presence causes the following conditional statement in the index.php file to evaluate as true and the included statements are then executed, which displays the Magento default “503 Service Unavailable” page. $maintenanceFile = 'maintenance.flag'; if (file_exists($maintenanceFile)) { include_once dirname(__FILE__) . '/errors/503.php'; exit; }
 magento maintenance mode 2   

2. Please note that as stated earlier, even admin user can not access the site. In order to make an exception and be able to access the admin section will need to edit the index.php file and place the following code on approximately line 47: $ip = $_SERVER[‘REMTE_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. magento maintenance mode 
After adding the above code you will also need to add your own IP address to the list to be able to access the admin panel. Now search for the following line of code and replace it with another given after that: If(file_exists)($maintenanceFile)){ if(file_exists($maintenanceFile) && (!in_array($ip, $allowed)){ That is it you are all set with maintenance page although if you wish to have a customised maintenance page then you need to edit the template located at the following location: errors/default/503.phtml
magento maintenance mode