cakePHP – Quick and Simple Maintenance page

How to setup a maintenance page in cakePHP – this is one of the ways:

Create new model:
app/models/offline.php

Create new controller:
app/controllers/offlines_controller.php

layout = ''; //empty layout - an example
		//$this->layout = 'header_only'; // I use my header-only layout which shows page header on the top
	}
}
?>

Create new view:
app/views/offlines/index.ctp

We are currently taking care of your data. Please check back later.

and add following line on the top of
app/config/routes.php

//MAINTENANCE - uncomment when maintenance
Router::connect('*', array('controller' => 'offlines', 'action' => 'index'));

When this line is left uncommented then all requests are redirected to the app/views/offlines/index.ctp page.

Hope this helps.

Please LIKE, Share, ReTweet. Thank you.

3 thoughts on “cakePHP – Quick and Simple Maintenance page

  1. Hello, i follow the procedure but nothing happend.

    ‘ve you an idea of what can be wrong, I’m on the latest version of cakephp. I’ve deleted the cache of chrome. I’ve commented all other router and my site still visible…

    I know that it’s very difficult to help with these poor informations, but I don’t know what I can say more.

    Thank you in advance.
    Diego

    ps : sorry for my english, but I’m french 🙂

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s