How to implement “Maintenance Mode” on already established website

后端 未结 6 952
天命终不由人
天命终不由人 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:07

    The simplest way would be to centralize some of the logic regarding site generation. This way you could turn maintenance mode on and redirect any non admins to a different page. This would not be hard to do, as I imagine you have some code that keeps popping up all over the place, so just extend the login functionality to check for a global variable (if you don't have any common global variables across your page you could just set it in .htaccess via setenv).

提交回复
热议问题