I'd like to require user user1
when the URL is /foo/user1/*
, user user2
when the URL is /foo/user2/*
, etc. Is it possible to do this?
For example, I'd like to do something like this:
AliasMatch ^/foo/([^/]+)(/.*)? /home/$1/foo$2
<LocationMatch "^/foo/([^/]+)(/.*)?">
SSLRequireSSL
AuthType Basic
AuthName "foo"
AuthUserFile /etc/apache2/htpasswd
Require user $1
</LocationMatch>