Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

approach for "site down for maintenance"

Tags:

php

kohana

I have been using Joomla and I love its administrative facility to put the site down for maintenance. As I have seen, all requests to the site if it is in maintenance mode is routed to a single page. If I want to add my own "site down for maintenance" module for a non-Joomla site, how do I do this? I am using an MVC framework in PHP called Kohana in its version 2 which is similar with Codeigniter. I have a Router class where I can control where a certain address go. The only approach I can think is redirect every request to a particular controller function when site is down, but how do I do this? I can't possibly manually re-route all urls right?

like image 425
yretuta Avatar asked Dec 03 '09 06:12

yretuta


1 Answers

Take a look at the routing documentation. You should be able to use a regular expression that redirects any uri to a specific controller/action. The only question left would be how to turn that rule on/off.

like image 62
Lawrence Barsanti Avatar answered Sep 28 '22 01:09

Lawrence Barsanti