I am using XAMPP on windows 7. I put this htaccess file in my htdocs
folder and I'm getting access denied when I try to open http://localhost/
.
Order allow,deny
Allow from 127.0.0.1
Allow from ::1
Deny from all
I want to deny access to any computers other than this one. How can I do this?
Precedence is everything!
If you allow localhost to connect, and afterwards deny ALL ips, the deny overwrites the allow.
So you'd first apply the blacklist (deny all) and then the whitelist (allow localhost).
Order deny,allow # <--- order to apply the white/blacklist change
Allow from 127.0.0.1
Allow from ::1
Deny from all
http://httpd.apache.org/docs/2.2/howto/access.html
The Order directive goes hand-in-hand with these two, and tells Apache in which order to apply the filters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With