I\'m trying to implement something like Mark Story\'s \"Down for Maintenance\" page using CakePHP 2.1.0. I\'m pretty close to achieving this, but I\'m running into two issues th
A more elegant way would be to add a route overriding any other one at the very top of routes.php
:
//Uncomment to set the site to "under construction"
Router::connect('/*', array('controller' => 'pages', 'action' => 'underConstruction'));
//any other route should be underneath
If you want to add any condition you can also do it here:
define('MAINTENANCE', 0);
if(MAINTENANCE > 0 && $_SERVER['REMOTE_ADDR'] !='188.YOUR.IP.HERE')
Router::connect('/*', array('controller' => 'pages', 'action' => 'underConstruction'));
}