Does anybody know if it's possible to apply htpasswd authentication to a particular directory ONLY if a specific ServerAlias is requested.

e.g. I have a single virtual host container, with 2 server aliases:

<VirtualHost 1.2.3.4:80>
        ServerName www.domain.com
        ServerAlias foo.domain.com

        <Directory /home/user/www>
                AuthType Basic
                AuthName "My Server"
                AuthUserFile /home/user/.htpasswds
                Require user myuser
        </Directory>

</VirtualHost>

Basically I just want the htpasswd authentication to apply if the server name requested is foo.domain.com and not www.domain.com

I know this can be done by creating a new virtual host container for foo.domain.com instead of using a serveralias, but I'd rather not do that if possible.

Thanks

Ben


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to