Hi guys,
I have a function:
$substring = substr($REMOTE_ADDR,0,9);
if ($substring != '192.168.0') {
echo "Access Denied";
exit;
}
If the user isn't from the local network, he's not allowed in.
This works fine, but is there a way to get apache to do it for me instead?
Like, this for example...
<Location /server-info>
SetHandler server-info
Order deny,allow
Deny from all
Allow from 192.168.0.0
</Location>
Is it possible to have apache do this for a Vhost? like this...
<VirtualHost *>
DocumentRoot /home/admin
ServerName admin.blabla.net
ErrorLog /home/logs/error.admin.net.log
CustomLog /home/logs/access.admin.net.log common
php_admin_flag safe_mode off
<Location /home/admin>
Order deny,allow
Deny from all
Allow from 192.168.0.0
</Location>
</VirtualHost>
See what I'm trying to do?
i've had a big fiddle, can't get it to work. Anyone got any ideas?
Cheers,
Liam
P.S. I know it's got to do with Apache mostly, but it kinda has some relation to
PHP... ;-)