Roxanne Mitchell Roxanne Mitchell - 7 months ago 51
PHP Question

How would I make an auto redirect for site maintenance?

I have made a maintenance page for my forums website but I need to add an auto redirect like say when the site is off maintenance mode how would I make then auto redirect them back to the index? - Sorry if this isn't that clear but it's hard to explain to me


You can set redirect header: header('Location: redirect_url');, it can be controled by some global variable and if statment:

$is_maintenance = true;
if($is_maintenance) header('Location: redirect_url');