We have one installation (let's call it example.com) with two domains (development.xpto.com and example.com) serving as alias (defined in sites.php) to the main site folder.

We wanted to put one of those aliases (the example.com) in maintenance mode and leave the development domain working np.

What's the best course of action to attain this functionality?

  • Thanks for the answer guys. The client wanted to make changes to their website using the development domain and activating/deactivating the production domain - without accessing the code - at certain times. I ended up hotfixing it by activating the maintenance mode by default and adding the following code to the settings.php of the website: <?php if($_SERVER['HTTP_HOST'] == 'development.xpto.com') $conf['maintenance_mode'] = FALSE; ?>
    – mariomc
    Jan 13, 2012 at 11:14

2 Answers 2


If they are aliases defined in sites.php, then you will have to unset the domain you want to turn off. Once you have unset it, create a folder sites/example.com/ and put a copy ofe sites/default/settings.php (or the settings.php you're using).

In it, write:

$conf['site_offline] = 0;

If your multi sites have separate databases than you can simply put whichever (sub)domain you desire into maintenance mode without effecting the other domains.

If you are using the Domain Access Module, you should navigate to that domain's maintenance page and put it in the mode you desire at subdomain.example.com/admin/settings/site-maintenance - see my screen captureenter image description here

  • I really didn't know that Domain Access could do this kind of thing. For sure a module to explore. Thanks a lot.
    – mariomc
    Jan 13, 2012 at 11:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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