Configuring htpasswd only for specific ServerAlias

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux