3

Is there some simple code that I can add to an .htaccess file or my virtual host file to enforce http basic auth?

1 Answer 1

6

What about this ?

AuthUserFile /my/derectory/.htpasswd
Require valid-user
AuthName "Secured Access"
AuthType Basic

the interesting part for you is Require valid-user

But if you can, please provide more informations about why you have you tried to do ^^

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. Just have to use htpasswd to create the password file httpd.apache.org/docs/2.0/programs/htpasswd.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.