I've been attempting to restrict access to an internet connected apache instance. My router has a port forward to the machine that is running apache. Don't know if this makes a difference.
Anyway I want to restrict it to LAN access only for the moment, and I want to use htaccess so that later I can enable visitors based on specific IPs. It is a dev server that I want my clients to be able to remotely preview, but not anyone else.
I've tried the instructions here: http://corz.org/serv/tricks/htaccess.php which explain to do this
order deny,allow deny from all allow from 192.168.1
In my .htaccess file, but this doesn't work, I can still access it from outside the lan. I'm trying it from my phone's 3g and it works.
If I change the order to something like
Order Deny,Allow Deny from all Allow from 192.168.1
(remove the comma) as per the apache docs here: http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html#allow and the page still allows access on my phone and on the local.