0

my .htaccess looks like this:

SetEnvIF X-FORWARDED-FOR "123.456.12.34" AllowIP
Order deny,allow
Deny from all
Allow from env=AllowIP

I want to combine this "whitelist" with a htpasswd: If a whitelisted IP accesses the server, a password request should be displayed.

Any ideas?

Thanks!

varlog
  • 61
  • 1
  • 3

1 Answers1

0

Adding the following lines solved it:

AuthType Basic
AuthName "Login"
AuthUserFile /path/to/.htpasswd
Require valid-user
varlog
  • 61
  • 1
  • 3