.htaccess: password protection or allow from IP

June 29th, 2010 — 3:59pm

If you want to enable HTTP AUTH password protection for your website (e.g. for development environment), but you want to keep it password free for some services or some users – this is how to set it up in Apache .htaccess file:

Order deny,allow
deny from all
AuthType Basic
AuthUserFile /var/www/dev/.htpasswd
AuthName "Members Area"
Require valid-user
Allow from 192.168.37.194
Satisfy Any

Comment » | Server

Back to top