2013-02-27 76 views
1

成功获得一个重写工作,我希望用我GIT设法打破这是需要推到git的验证之后。mod_rewrite的休息的HTTP基本验证

出于某种原因,如果ScriptAlias的重写如果请求http://username:[email protected]/会导致认证信息丢失,从而导致无法推送数据。

<VirtualHost *:80> 
DocumentRoot /home/subgit/repos 

    <Directory /home/subgit/repos> 
     Options  None 
     AllowOverride none 
     Order   allow,deny 
     Allow   from all 
    </Directory> 

CustomLog /home/subgit/logs/access_log combined 
SuexecUserGroup subgit subgit 

RewriteEngine On 
RewriteCond %{HTTP_USER_AGENT} ^git 
RewriteRule ^(.*)$ /git/testrepo/$1 [PT] 

RewriteCond %{QUERY_STRING} service=git-receive-pack [OR,NC] 
RewriteCond %{REQUEST_URI} ^/git/.*/git-receive-pack$ [NC] 
RewriteRule .* - [E=AUTHREQUIRED:yes] 

ScriptAlias /git/ /home/subgit/bin/gitolite-suexec-wrapper.sh/ 

<LocationMatch "/git/"> 
    Order Allow,Deny 
    Deny from env=AUTHREQUIRED 
    Allow from all 
    Satisfy Any 
    AuthType Basic 
    AuthName "subgit" 
    AuthBasicProvider file 
    AuthUserFile /home/subgit/etc/subgit 
    Require valid-user 
    </LocationMatch> 
</VirtualHost> 

回答

1

由于[PT]还需要[L]以下的任何规则未执行,移动上面的AUTHREQUIRED规则解决了问题。