Roxanne Mitchell Roxanne Mitchell - 1 year ago 92
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

Answer Source

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');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download