0

I have users in .htpasswd and allowed IPs in .htaccess I want to allow either user/password (for IPs not in .htaccss) OR IPs to access (without auth).

I edited the dir section in httpd with these lines But its asking for user/password for the allowed IPs and IPs not in the file are not asked to authenticate.

<Directory xxx>
    AllowOverride All
    Options Indexes FollowSymLinks
    AuthName "Authentication required!"
    AuthType Basic
    AuthUserFile <my path>/.htpasswd
    <RequireAny>
        Require ip 127.0.0.1
        Require valid-user
    </RequireAny>
</Directory>
Nsh
  • 29
  • 6

1 Answers1

0

These configs worked for me

  AllowOverride All
  AuthType Basic
  AuthName "Authentication Required"
  AuthUserFile "/my path/.htpasswd"
  Require valid-user
  satisfy any
  deny from all
  allow from x.x.x.x
Nsh
  • 29
  • 6