Tuesday, January 24, 2012

Allow from IP without password prompt, and also allow from any address with password prompt

You should write in .htaccess as follows:

Order deny,allow
Deny from all
AuthName "htaccess password prompt"
AuthUserFile /Path-to-Your-Password-File/.htpasswd
AuthType Basic
Require valid-user
#Your Allowed IP Here:
Allow from XXX.XXX.XXX.XXX
Satisfy Any

No comments: