How to Bring Down an Emergence Instance for Maintenance


#1

If you want to push updates to an emergence site while keeping the site down to the world you can use the following trick:

At the bottom of /php-config/Site.config.php add the following statement:

if (empty($_COOKIE['devcookie'])) {
    header('HTTP/1.1 503 Service Temporarily Unavailable');
    die('Please check back in a few moments');
}

Then in the browser you’d like to do your edits in, open up the javascript console and manually set your cookie:

document.cookie="devcookie=1";

Now only users with this specific cookie set will be able to access the site. When you’re done remove the Site.config.php statement and you’re good to go.