Thursday, January 20, 2011

How to limit web access by password and IP address using .htaccess ?

We're trying to lock down our administrative site by requiring a password AND requiring that the request is coming from an authorized IP address. We've figured out how to do both separately, but can't figure out how to combine the two.

AuthName     "Restricted Access"
AuthUserFile /usr/www/users/directory/.passwd
AuthType     Basic
Require valid-user
Order deny,allow
Deny from all
Allow from 79\.1\.129\.85
Satisfy Any

This is the closest we've come. BTW, we also want to be able to enter multiple IP addresses on the white list.

0 comments:

Post a Comment