NOV 06 2014

How to turn Magento Maintenance ON or OFF

Magento has built-in Maintenance mode which is ready to use with simple minimalistic approach. For advanced features, like switching maintenance mode on per-store-view basis from Magento Backend, please skip to the next section.

Magento maintenance mode is controlled by maintenance.flag file under Magento’s root and coded in Magento’s index.php file:

$maintenanceFile = 'maintenance.flag';

if (file_exists($maintenanceFile)) {
    include_once dirname(__FILE__) . '/errors/503.php';

To turn maintenance mode ON this file (with any content) needs to be placed in Magento root, i.e.:

$ cd /path/to/magento/root/public_html/
$ ls
LICENSE.html cron.php includes  mage LICENSE.txt  index.php media
LICENSE_AFL.txt downloader index.php.sample pkginfo RELEASE_NOTES.txt errors install.php shell api.php favicon.ico js skin app get.php lib var

$ touch maintenance.flag


To turn Mageno maintenance mode OFF you need to delete this maintenance.flag file:

$ rm maintenance.flag

Or, just use file manager to create or delete it:

Deleting maintenance.flag in Magento's root
Deleting maintenance.flag in Magento’s root using Filemanager


Important! When your store is under maintenance, it should return error code 503 in  status response. This way search engines will understand that content is temporarily unavailable and will re-crawl it later. If your store will respond with simple 200 OK response status, search engines can treat maintenance page just like a content replacement and index maintenance page instead of your content.


Magento Extension for Maintenance mode.


If you wish, you can manage maintenance mode on per-store-view basis, switching maintenance mode for each store view separately from Magento Backend. It can be achieved with a special extension from Magento Connect, Maintenance Page.

Just install this extension using its extension key (it is community/ArtsOnIT_OfflineMaintenance ). If you are unsure on how to install Magento extensions, please refer to Installing and Managing Magento extensions. Logout and Login to Magento backend (to avoid 404 error on the extension settings page) and navigate to System > Configuration > Advanced > Offline Maintenance (1), select desired Store View under Configuration Scope section (2), configure maintenance mode (3) and click on Save Config button (4):

Configuring Maintenance mode for some store view in Magento Backend
Configuring Maintenance mode for some store view in Magento Backend


Posted in: Magento Maintenance

How to turn Magento Maintenance ON or OFF
3 votes, 2.08 avg. rating (52% score)