Search code examples
weboffline-mode

Need suggestions , making function to "put site offline"


I am upto making a function for mine website's administrator to put it offline. But site must be some way accessible for administrators or mods.

What way i should do it ?


Solution

  • Somewhere in the includes:

    if($mainstance == 1){
        if(strpos($_SERVER['REQUEST_URI'],'/admin/') === false) die("Site's down");
    }
    

    This would make everything but the /admin/ directory inaccessible.