How to implement “Maintenance Mode” on already established website

后端 未结 6 955
天命终不由人
天命终不由人 2020-12-04 20:33

I have built a website (PHP) with more than 60 pages. I have only now realized (unfortunately) that I should have built in an \"In Maintenance Mode\" feature to allow an adm

6条回答
  •  生来不讨喜
    2020-12-04 21:09

    I know this is an old question but I am adding this for future searchers who come across this page via searching.

    I use a PHP redirect.

    At the top of every page add the following lines:

    
    

    And in your config.php file just make a variable like so

    $maintenance = 0; // turns maintenance mode off
    

    When you want your site to be in maintenance mode just change the "0" to a "1". This will redirect all your site visitors to a maintenance page.

    I typed that code pretty fast without testing it but it should work.

提交回复
热议问题