Limit Access to Designated IP Addresse
Tweet Follow @3pixelssolution[php]
<?php $allow = array("192.168.0.103", "45.120.124.38", "789.123.456");
if(!in_array($_SERVER[‘REMOTE_ADDR’], $allow) && !in_array($_SERVER["HTTP_X_FORWARDED_FOR"], $allow)) {
$retry = 60 * 60; // = 60 minutes
header("HTTP/1.1 503 Service Unavailable");
header("Retry-After: $retry");
echo "
<h1>Site update in progress – Please return in 60 minutes!</h1>
";
exit();
} ?>[/php]