Does anyone know if it's possible to use regex capture within Apache's DirectoryMatch directive? I'd like to do something like the following:
<DirectoryMatch ^/home/www/(.*)>
AuthType Basic
AuthName $1
AuthUserFile /etc/apache2/svn.passwd
Require group $1 admin
</DirectoryMatch>
but so far I've had no success.
Specifically, I'm trying to create a group-based HTTP Auth for individual directories/vhosts on a server in Apache 2.0.
For example, Site A, pointing to /home/www/a will be available to all users in group admin and group a, site b at /home/www/b will be available to all users in group admin and group b, etc. I'd like to keep everything based on the directory name so I can easily script adding htpasswd users to the correct groups and automate this as much as possible, but other suggestions for solving the problem are certainly welcome.