Apache Authorization: Require password if IP not white-listed

I have a list of IP addresses for people who should be granted access to the website.

Everybody else should be required to enter a password.

My code does not work.

Order deny, allow 
Deny from all 
AuthName "Authorization Required" 
AuthUserFile "/home/html/.htpasswd" 
AuthType Basic 
Require valid-user 
Allow from 11.22.33 
Allow from 22.22.33.44 
Allow from 55.44.33.22 
Satisfy Any

Open in new window

LVL 16
hankknightAsked:
Who is Participating?
 
Steve BinkCommented:
Try this instead:
AuthName "Authorization Required" 
AuthUserFile "/home/html/.htpasswd" 
AuthType Basic 
Require valid-user 
Order allow,deny
Allow from 11.22.33 
Allow from 22.22.33.44 
Allow from 55.44.33.22 
Satisfy Any

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.