magentowebshopmagento-1.4

How to put magento in maintenance


Is it possible to put a magento site under an maintenance flag so that visitors will get a message that the site is under construction? I can't find this setting in the admin area.

Another solution will also be welcome.

Any help would be appreciated.

Thank you.


Solution

  • I use this often. http://inchoo.net/ecommerce/magento/maintenance-mode-in-magento/

    The important part is:

    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);

    $ip = $_SERVER['REMOTE_ADDR'];
    $allowed = array('1.1.1.1','2.2.2.2'); // these are the 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)) {