Knowledge base

Magento maintenance

Magento Maintenance mode is generally used by the store developers to adjust the store settings and other manipulations that may result if frontend instability.

 

To enable the Maintenace mode it is only required to create an empy maintenance.flag file in the Magento root folder (the folder containing such folders as: /app, /var etc.). Once the maintenance.flag file is created when navigating to the store frontend or backend one will be given the following page:

 

 

The access to the store will be restricted to this 503 page. To enable access to the store during the maintenance one will need to list the IP addresses allowed in the index.php file.

To do this open index.php file in Magento root folder and do the following:

 

1) Add:

 

$ip = $_SERVER['REMOTE_ADDR'];

$allowed = array('1.1.1.1','2.2.2.2');

 

Where 1.1.1.1 and 2.2.2.2 examples of the IP addresses that would be allowed access to the store frontend and backend.

Please note, if you are hosting local Magento store internal IP address will be required to access the store frontend and backend.

 

2) Find the following line:

 

if (file_exists($maintenanceFile)) {

 

and change it to:

 

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

 

 

Done. Now you can access the store frontend and backend pages while having your store on maintenace for everyone else.

Once you are done with the maintenance just remove maintenance.flag file from Magento store root folder.

 

In case you are putting your store on a maintenance to optimize the overall performance you may also be interested in aheadWorks Optimization service. Feel free contacting our help desk team if you have any questions.

 


Services You May Be Interested In

 

Custom Development

Custom Development

Professional assistance by aheadWorks trusted partners to customize your store.
Magento Performance Optimization

Magento Performance Optimization

Magento performance optimization provided by aheadWorks trusted partners.

Please wait...

added to cart
Go to Checkout Continue Shopping
Continue shopping
View cart & checkout