<Location "/site">
Allow from all
ProxyPass ajp://localhost:8009/site
</Location>
<Location "/site2">
Allow from all
ProxyPass ajp://localhost:8009/site2
</Location>
<Location /svn>
DAV svn
SVNParentPath /home/svn
SVNListParentPath On
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/subversion/passwd
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
RewriteEngine On
#RewriteCond %{HTTPS} off
RewriteCond %{query_string} !^/svn/.*
RewriteRule (.*) %{HTTP_HOST}%{REQUEST_URI}
RewriteRule (.*) ajp://localhost:8009/$1 [P]
我的问题是规则应用于 /svn 位置并总是给出 //svn 请帮忙
答案1
您的 RewriteCond 匹配 ,svn/
因为您不想意外匹配svnabc
,但是,当然,svn
如果没有尾部斜杠,它也不会匹配。 也许更/svn(/.*)?$
接近您想要的,即“以 /svn 开头,然后可能是其他内容,但必须以斜杠开头”?