I have an old subversion repository that was set up as the only repo on a machine. We accessed the URLs like this:
http://myserver.com/svn/trunk/... http://myserver.com/svn/branches/... We're moving to a new server where we have several repositories set up under a dav-svn installation under apache2, so by default we access them like this:
http://myserver.com/svn/repo/trunk/ http://myserver.com/svn/repo/branches/ or http://192.168.0.1/svn/repo/trunk/ http://192.168.0.1/svn/repo/branches/ I need to move the old repo to the new machine without changing the URLs, so I want to set up a repo and then have apache redirect it depending on the url, so:
http://myserver.com/svn/trunk redirects to
http://myserver.com/svn/repo/trunk transparently. I can get it to redirect to the IP-based URL, but when I try to get it to redirect using the domain name itself, it gives me forbidden messages or "Could not open the requested SVN filesystem":
<VirtualHost *:80> ServerName myserver.com ServerAlias www.myserver.com DocumentRoot /var/www/vhosts/myserver.com/html CustomLog /var/www/vhosts/myserver.com/logs/access_log combined ErrorLog /var/www/vhosts/myserver.com/logs/error_log RewriteEngine On RewriteRule ^/svn(.*)$ /svn/myrepo$1 [L,QSA] # THE FOLLOWING WORKS, BUT IS NOT TRANSPARENT # RewriteRule ^/svn(.*)$ http://192.168.0.1/svn/myrepo$1 [L,QSA] <Directory /var/www/vhosts/myserver.com/html> AllowOverride All </Directory> </VirtualHost> And the subversion.conf file:
<Location /svn> DAV svn SVNParentPath /var/svn/repository AuthType Basic AuthName "Subversion Repository" AuthUserFile /var/svn/repository/.htpasswd Require valid-user </Location> Ideas on how to solve the problem?