Need help buying now? +48-22-219-5163 +1-917-720-3250
My Cart

Your Cart is Empty

Need help buying now?
+48-22-219-5163 +1-917-720-3250

Maintenance mode for Magento system

Maintenance mode for Magento system

Working with the site engine is quite a difficult task which requires attention and responsibility. Let us review how to configure maintenance mode option for Magento system.

What do to if you need to close the site

Let’s suggest your store is unavailable due to some external reasons (e.g. hosting server issues or some of Magento extensions do not work properly). In this situation it is most logical to close the store until the problem is fixed, otherwise you may lose many customers including your permanent ones.

What is NOT recommended when you temporarily close the site:

1. Close access to the site and do not display any information as to the reasons and terms of the site being unavailable. Put yourself in customer’s shoes – they have just ordered a product and suddenly the site is closed. They will hardly come to your store again.

2. Blame someone else (e.g. your hosting company). They may be guilty, of course, but you should simply explain your visitors that the site is unavailable due to external reasons which are not under your control and everything possible is being done to fix the problem in the shortest time.

3. Do not specify any approximate time of maintenance period end. If you need to edit your online store you may ask Magento development team to help you calculate the necessary time.

Configuration of the maintenance mode

The online store administrators often need to configure the front-end interface to inform their visitors about the technical work in progress. This is called ‘maintenance mode’ in Magento system. A step-by-step instruction to enable it is below:

1. It order to put your site into maintenance mode create a new empty file called ‘maintenance.flag’ and upload it to the server;

2. You must understand that when maintenance mode is enabled even the administrator will not have access to the admin panel. If you wish to allow the administrator to be able to access the admin panel and make some configurations you need to edit the file index.php. Open it using an editor, or download it to your computer and then open with the help of Notepad. You need to replace the line 47 with the following code:

$ip = $_SERVER['REMOTE_ADDR'];
$allowed = array('69.65.23.100','2.2.2.2');

 

In the line $allowed = array(‘69.65.23.100′,’2.2.2.2′); you will need to specify to which IP addresses the store will be available (here you need to specify your administrator’s IP, webmaster’s IP and your own one).

3. After that locate this part of code:

if (file_exists($maintenanceFile)) {

 

and replace it with:

if (file_exists($maintenanceFile) && !in_array($ip, $allowed)) {

 

4. Save the changes and refresh the store page. If the site is available to you then you have done everything correct, if not – you should check correctness of the data you have added to index.php.

You can use any other text beside the default ‘The site is under construction’, etc. Just go to the file errors/default/503.phtml and change the text. Do not forget to save all changes you make. Try to address your visitors not too officially but without excessive familiarity. Besides, if there are not processed orders remaining when your site has gone into maintenance, make sure you inform your customers that you are working on the problem and they will soon receive the products they have ordered or will be issued a refund. Some marketing specialists even advise to use infographics or just an appropriate image with the explanation of the situation.

If you have any questions please feel free to contact us by leaving a comment to the article or directly by email. We also recommend you to read other articles in our Magento Blog and share the most interesting of them with your friends and colleagues.

Newsletter