I am trying to set up an alias with permissions different than the root, like
www.restricted.com - one user
www.restricted.com/alias - another user
Is this possible?
I've set up the alias in httpd.conf at a separate directory (not subdirectory) with its own <directory> entry and separate auth setup. However, I get two password requests when trying to access /alias, for both sections. I am not sure whether it's because of a mistake on my part or by design.
Example:
<VirtualHost *:443>
ServerName www.restricted.com
DocumentRoot /var/www/site/main/
<Directory /var/www/site/main/>
AuthUserFile /var/www/site/.htpasswd
AuthGroupFile /dev/null
AuthName "main site"
AuthType Basic
Require user joe
</Directory>
Alias /alias /var/www/site/subsite/
<Directory /var/www/site/subsite/>
AuthUserFile /var/www/site/.htpasswd
AuthGroupFile /dev/null
AuthName "subsite"
AuthType Basic
Require user admin
</Directory>
</VirtualHost>
As the virtual host root and the alias are located in separate directories on the server, I think that <Directory> directives are more appropriate to use than <Location>.