I am using an .htaccess directive to protect entire folders, allowing access only to a range of IP within the intranet.
Order Deny,Allow
Deny from all
Allow from 192.168.2.0/24
ErrorDocument 403 /redirect.php
I'd like to do the same for one vb file: register.php. Placing the code below requires that I would have to put in 250 IP.
$ipaddy = getenv ("REMOTE_ADDR");
if ($ipaddy != "the ip") {
header("location:http://site.com/page.htm");
}
Is there an easy way to do it in PHP?
Order Deny,Allow
Deny from all
Allow from 192.168.2.0/24
ErrorDocument 403 /redirect.php
I'd like to do the same for one vb file: register.php. Placing the code below requires that I would have to put in 250 IP.
$ipaddy = getenv ("REMOTE_ADDR");
if ($ipaddy != "the ip") {
header("location:http://site.com/page.htm");
}
Is there an easy way to do it in PHP?
Comment