CakePHP 2.1.0: How to Create “Down for Maintenance” Page

前端 未结 3 917
旧巷少年郎
旧巷少年郎 2021-02-10 19:03

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

3条回答
  •  逝去的感伤
    2021-02-10 19:25

    here is a quick and dirty maintenance page for cakephp

    in public index.php

    define('MAINTENANCE', 0); 
    if(MAINTENANCE > 0 && $_SERVER['REMOTE_ADDR'] !='188.YOUR.IP.HERE')
    {
    require('maintenance.php'); die(); 
    }
    

    Then just change MAINTENANCE = 1 when you want to take your site down and it will still be viewable from your home/office.

    BONUS: Works with all versions of cake!

提交回复
热议问题