Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

when opening an subversion URL like https://server.local/svn/reproname using a normal webbrowser I get a (not very nice but useful) webpage showing me the files of the highest revision of the repository.

Is it possible to change this HTML-view to use WebSVN instead? So I want to use the same URL for TortoiseSVN which then browses the repository using WebDAV and for browsing it with a webbrowser getting the nice interface of WebSVN.

I am using Apache 2.2 on an Win 2003 Server with mod_dav_svn.

Thanks in advance for any help.


share|improve this question
up vote 2 down vote accepted

What about using mod_rewrite? You could do something like this:-

RewriteCond %{HTTP_USER_AGENT}          !^SVN.*
RewriteRule ^/svn/(.*?)(/.*)$ $1&path=$2      [R]

This should redirect any client that doesn't have a User-Agent string starting with 'SVN/' to a WebSVN installation at, and leave queries from SVN clients alone.

share|improve this answer
Interesting but it could break some third party svn clients – Alexandre Jasmin Feb 25 '10 at 2:13
Great idea! Didn't know this was possible. – Andrew Strong Feb 25 '10 at 5:15
Hi Alexandre, Yeah - I'm aware it could cause issues with some, but it's a start :-). If it's that much of a problem, you could flip the User-Agent stuff and only redirect to WebSVN if it positively matches for Mozilla or such. – Andy Smith Feb 25 '10 at 12:59

I too tried to get it to work like this, but I don't think it's possible. According to this site, mod_dav_svn generates the html page you see, and it only supports simple skinning using xslt.

What I did was use a new virtual host for my WebSVN content (eg https://websvn.server.local/svn/reponame).

share|improve this answer

Solved it with mod_rewrite as Andy suggested. I am using this set of rules now

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^SVN.*
RewriteRule (.*) - [S=3] 
RewriteRule ^svn$ /svn/ [R,N]
RewriteRule ^svn/$ /websvn/ [R,L]
RewriteRule ^svn/(.*?)(/.*)$ /websvn/listing.php?repname=$1&path=$2 [R,L]

This checks for the User-Agent to start with SVN (this is how Tortoise identifies) and then skips the next three rules.

Those three rules are doing the following:

  • add the trailing slash to the svn-URL (not done automatically because svn is no directory)
  • redirect the direct access to the repository list
  • redirect direct repository view

All this is done in the <Directory>-directive of the RootDir.

Thanks Andy for this hint!


share|improve this answer
No worries - glad it was useful :-) – Andy Smith Feb 26 '10 at 20:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.