Question

I have a site hosted on hostgator that I've set up with a directory to use htaccess/htpasswd for authentication. It's working fine but only for a user named test.

Here's the relevant htaccess

<filesMatch "(-priv)">
    AuthType Basic
    AuthName "Private Area"
    AuthUserFile /home/username/public_html/site/test/.htpasswd
    Require user test
</filesMatch>

and the htpasswd has 2 users

test:ovCvloB9kYgBQ
admin:RxvCRMqtdryys

I can log in using the test user but if I use any other name authentication fails. I can change the password for the test user and authentication reflects the change. The behavior is consistent across browsers and IPs.

Is there any way to debug this?

And before you say it, I know not to put the .htpasswd file above webroot, this is a test setup.

Était-ce utile?

La solution

You have Require user test

Change to Require valid-user

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top