.htaccess authentification for external visitors

12/04/2006 9:52 | Internet, Software | 5130 views | RSS

I have a gallery installed on my local webserver at home – accessible from the internal network, and also via the internet. I had the idea that everyone in my network should be able to access that gallery without authentification, but everyone visiting from the internet should log in with a username and password.

I’ve created the following .htaccess file, which does exactly what I was looking for:

AuthUserFile D:/security/htaccesspasswords.txt
AuthName "home.damn.be"
AuthType Basic

<Limit GET POST>
order allow,deny
allow from 10.0.0.
Satisfy any
require valid-user
</Limit>