httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Roberts <list-supp...@headsnet.com>
Subject [users@httpd] Configuring htpasswd only for specific ServerAlias
Date Fri, 02 Feb 2007 14:48:26 GMT

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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message