3

[ubuntu] htaccess allowing one ip with authentication?

view full story
linux-howto

http://ubuntuforums.org – Hi, i want to set up .htaccess on my Apache web server such that all users are straight-up denied access except one user which is my IP. Since this IP represents my entire home network, I also want to add authentication in the case the IP is correct to ensure that only I can access that directory and no one else using my home network. This is how my .htaccess file looks so far: Code: Order deny,allow Deny from all AuthType Basic AuthUserFile /var/www/path_to_forbiden_dir/.htpasswd AuthName "Protected" require valid-user Allow from xxx.xx.xx.xxx where xxx.xx.xx.xx (Hardware)