0

I followed simple steps to make a password protected webpage, but it does not work i.e. I can open the page from any browser and it does not ask me to login to view the page. The .htaccess file looks like this

AuthUserFile PATH/.htpasswd
AuthGroupFile /dev/null
AuthName "Please Login"
AuthType Basic
<Files "index.html">
require valid-user
</Files>

and the .htpasswd file contains username:encrypted password

UPDATE: This article helped me to fix that issue.

0

1 Answer 1

1

It seems that you are missing this:

AuthBasicProvider file

Also check that Apache is allowed to read your .htaccess file via AllowOverride (link)

1
  • I was changing the line from AllowOverride none to AllowOverride AuthConfig in the section that begins with <Directory > instead of <Directory "/var/www/html">.
    – viz12
    Jun 30, 2017 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.