I would like to have multiple website in my Magento Server. But I need to put only one website under maintanence not the entire server.


The commands in the above link is turning the entire server to maintanence mode. But, I need to turn only a particular website to Maintanence mode and also I should access the REST API's during the maintanence period.


I know 2 ways of doing:

1st and easiest, simple create a page you want to display, name it as index.php and replace your file on public_html

2nd, go to your index.php file, and add this code on line 49:

$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
$maintenanceFile = 'maintenance.flag';
$allowed = array('',''); //insert your allowed IP here

if (!file_exists($mageFilename)) {
    if (is_dir('downloader')) {
        header("Location: downloader");
    } else {
        echo $mageFilename." was not found";

if (file_exists($maintenanceFile) && !in_array($ip, $allowed)) {
    include_once dirname(__FILE__) . '/errors/503.php';

Remember to always have the backup updated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.