$myIPs = array( 'x.x.x.x', 'y.y.y.y', 'z.z.z.z' );
if( ! in_array( $_SERVER['REMOTE_ADDR'], $myIPs ) ) {
header( "Location: http://www.example.ru/index.php" );
exit;
}
<?php
if ($_SERVER['REMOTE_ADDR'] !== '8.8.8.8')
{
header("Location: /", true, 301);
}
<?
//!!!!!!!!!!!!!!!!!!!!!!!!!!!
$myhost="1.1.1.1";
//!!!!!!!!!!!!!!!!!!!!!!!!!!!
if ($myhost!=$_SERVER['REMOTE_ADDR'])
{
header("Location: http://www.example.com/");
exit;
}
?>
Hi!
ErrorDocument 403 /index.php
<Files "admin.php">
Order Deny,Allow
Deny from all
Allow from 1.1.1.1
</Files>