CodeIgniter Forums
Site down option - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Site down option (/showthread.php?tid=20070)



Site down option - El Forum - 06-26-2009

[eluser]nZac[/eluser]
I am posting this here but it may need to go into the feature request. Is there a way to redirect to a page no matter what the url call is unless you have a session variable set.

The goal is to be able to quickly shut down a website and any requests get sent to a site maintenance page.

Any suggestions?


Site down option - El Forum - 06-27-2009

[eluser]skunkbad[/eluser]
Put an if statement that checks the IP address of an incoming request at the top of index.php.

Find out your IP, and set the if statement to display the site maintenance message if the IP isn't yours.

You will have access to the whole site.


Site down option - El Forum - 06-29-2009

[eluser]louis w[/eluser]
For my application I have a controller named Application, everything extends this Controller. Inside I place all the code which is shared across all areas of the site. You could do something like this and put a check in there weather or not the site is up.