How to put magento in maintenance

后端 未结 13 838
北海茫月
北海茫月 2021-02-01 21:45

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 a

13条回答
  •  旧时难觅i
    2021-02-01 22:17

    Thats what I add to the index in order to be able to continue working from different IPs:

    //EGS to show a maintenance page but be able to work
    $ip = $_SERVER['REMOTE_ADDR'];
    
    // these are the IP's that are  allowed to view the site:
    $allowed = array('111.111.111.111', '222.222.222.222');
    
    if (file_exists($maintenanceFile) && !in_array($ip, $allowed)) { 
        include_once dirname(__FILE__) . '/errors/503.php';
        exit;
    }
    

提交回复
热议问题