用SVN重写url

我目前有几个svn回购的设置供一小群人使用。 他们目前通过以下url模式访问repo: https : //svn.example.com/svn/project如果他们有多个软件包(有些但不是全部): https : //svn.example.com/ svn / project / packageA等等。

我想删除/ svn /出url。 我已经尝试在Apache中使用RewriteRule和RedirectMatch没有成功。

在尝试更改URL之前,这是虚拟主机文件:

<VirtualHost *:443> ServerAdmin [email protected] ServerName www.svn.example.com ServerAlias svn.example.com DocumentRoot /var/svn SSLEngine on SSLCertificateFile /etc/apache2/ssl/apache.pem SSLProtocol all SSLCipherSuite HIGH:MEDIUM <Location /var/svn/> DAV svn SVNParentPath /var/svn SVNListParentPath on AuthType Basic AuthName "Subversion Repository" AuthUserFile /var/svn/svn-auth-file Require valid-user </Location> ErrorLog /var/log/apache2/error.log LogLevel warn CustomLog /var/log/apache2/access.log combined ServerSignature On </VirtualHost> 

有什么build议么?

前言

  1. 写的configuration不能反映你描述的configuration: /svn path vs /var/svn/ location
  2. 你的configuration一定不能工作(或者有很大的麻烦 ):DocumentRoot == Location == SVNParentPath,因为它们是a)不相关的b)不同的参数

当你想改变你的回购path时,你只能重写SVN位置的定义,它可以是/你的情况(注意:在这种情况下,如果所有站点都是存储库,则根下的非WebDAV树会有问题只有根位才行)

对你的问题<Location />是简短的回答

假设你有两个svn仓库位于:

  1. 在/ var / SVN / repo1
  2. 在/ var / SVN / repo2

所以URL是:

  1. http://svn.example.com/repo1/project1/PackageA
  2. http://svn.example.com/repo2/project1/PackageA

要求要使用URL访问repo1Project1PackageA

 http://svn.example.com/project1/PackageA 

可能的解决scheme

 -<Location /var/svn/> +<Location /> DAV svn -SVNParentPath /var/svn +SVNPath /var/svn/repo1 -SVNListParentPath on AuthType Basic AuthName "Subversion Repository" AuthUserFile /var/svn/svn-auth-file Require valid-user </Location> 

而且,重启httpd。