Answer the question
In order to leave comments, you need to log in
How to set up http authentication?
Colleagues, welcome!
There is a certain corporate portal which is twisted on the local server.
We began to provide access to external users. For greater security, I also decided to make http authentication using the .htaccess file. The question arose, how to make http authentication only for external users?
For users with IP 192.168.0.0/24 http authentication is not required.
Answer the question
In order to leave comments, you need to log in
for apache 2.4
<Directory /you_dir/>
<If "%{REMOTE_ADDR} -ipmatch '192.168.0.0/24'">
Require all granted
</If>
<Else>
AuthType Basic
AuthName "Password Protected"
AuthUserFile <path_to_your_htpasswd_file>
Require valid-user
</Else>
</Directory>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question