Link to home
Start Free TrialLog in
Avatar of zattz
zattz

asked on

htaccess auth / allow from ip

Hi

I have the following in my htaccess for password protection:

<Directory "/var/www/html">
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/httpd/conf/access
Require user john
</Directory>

How can I allow access without a password from IP x.x.x.x and y.y.y.y

Thanks
Avatar of sompol_kiatkamolchai
sompol_kiatkamolchai
Flag of Thailand image

Please use mod_access instead, here is reference
http://httpd.apache.org/docs/1.3/mod/mod_access.html
Avatar of zattz
zattz

ASKER

How do I use that with the password?
ASKER CERTIFIED SOLUTION
Avatar of sompol_kiatkamolchai
sompol_kiatkamolchai
Flag of Thailand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of zattz

ASKER

I have tried the following but it dosnt work. It is not asking for the password.

<Directory "/var/www/html">
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/httpd/conf/access
Require user john
Allow from X.X.X.X
Satisfy any
</Directory>