function isMaintenance($maintenance)
{
if(isset($maintenance) && $maintenance){
header("location:maintenace_page.php");
exit();
}
}
In config.php add $maintenance variable,
$maintenance =true;
and include isMaintenance($maintenance) function page and config page in respective page or if you already included any common file all the pages then use that file and add mentioned stuff into that page.