Forum Moderators: phranque
<Limit GET HEAD POST>
order allow,deny
deny from 192.168.1.101 (just an example)
allow from all
</LIMIT>
I only managed this with help from various sites on the internet, rather than my own knowledge.
The file is in the HTDOCS directory. When I try to access from a supposedly blocked pc it still works. It's as though the HTACCESS is being ignored.
I have tried using Windows folders permissions to deny access but no luck.
Is my HTACCESS correct?
Or should I use the HTTPD file to do this?
Please don't reply with too complicated an answer.
See the mod_access tutorial at, [httpd.apache.org...]
If you copied this mod_access [httpd.apache.org] code and have little understanding of it, then it would be best to start with a very simple test:
Order allow,deny
<Files *>
Allow from all
Deny from 192.168.1.101
</Files>
After any change to any access-control code on your server, you must flush your browser cache before testing, in order to get valid test results.
Get simple code working first before adding more features and their attendant complications.
Jim
Also, as I mentioned, the name of the htaccess file must match the filename configured in httpd.conf as well, if that configured name is different does not exactly match the default name ".htaccess".
Putting your code in httpd.conf is usually more efficient, however, except that the server must be restarted every time you change it.
Jim