php - CakePHP 2.6.7: How to block website access when updating -
sorry english not enough don't know how search it.
as title, want block website when update new data (such as: source code or database).
i have tried make index.html file , upload host website still access index.php. have tried rename or delete index.php file. not successful !
so reason why made question ask this.
summary: how can block or stop user access website when updating it?
create index.html file in app/webroot 'maintenance' message.
then in appcontroller::beforefilter method
if($this->request->clientip() != 'your ip address') { $this->redirect('/index.html'); }
your ip address can on localhost ::1 or 127.0.0.1, on remote host use real ip http://www.myipaddress.com/show-my-ip-address/
with approach, can still access web application, else see index.html page.
Comments
Post a Comment