Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have 3 webapps running on my machine on different ports like:

If I add to my httpd.conf:

<Location "/">
AuthUserFile /my/file/with/users
AuthName "This is a protected area"
AuthGroupFile /dev/null
AuthType Basic
Require valid-user

The authentication works fine, but I want to be able to have Apache authentication only when the user enters "" and not yyy/zzz, is it possible without using .htaccess files and the <Location>?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

yes, use virtual hosts:

share|improve this answer

Yes, you can do it by putting in the Directory directive (into VirtualHost) instead of using .htaccess.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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