2013-02-27 73 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規則解決了問題。