是否有可能从apache LocationMatch指令获得匹配的正则expression式?
我想知道下面的代码应该工作: <LocationMatch "/(.*)([/])?(.*)"> Order allow,deny Allow from all AuthType Basic AuthName "Git" AuthUserFile /git/.htpasswd AuthGroupFile /git/.htgroup Require group $1 </LocationMatch> 我试图实现这个是要求基于第一个正则expression式variables的组。 因此,如果用户转到http://localhost/a-repository-name他必须在组a-repository-name中才能打开url。 出于某种原因,我不能得到这个代码的工作和Apache返回: Authorization of user **** to access /a-repository-name failed, reason: user is not part of the 'require'ed group(s). 我想这不符合Require group $1的正确variables。 这是正确的做法,或者我错过了什么?