Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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

I want to setup SVN in such a way that svn.domain.com/ directly lists SVN repositories. To be able to make the web view nicer I am using an SVNIndexXSLT. But I have to serve this file somehow to the end-user.

So I want to setup a location (/repos-web for example) that will serve files, instead of svn.

I currently have the following configuration:

<VirtualHost *:80>
        ServerName svn.domain.com
        DocumentRoot /home/user/svn/svnweb
        ErrorLog ${APACHE_LOG_DIR}/error.log
        <Location />
                AuthType Basic
                AuthName "Authentication required"
                AuthUserFile "myauthfile"
                Require valid-user
                order allow,deny
                allow from all

                DAV svn
                SVNParentPath /home/user/svn/repositories
                SVNListParentPath on
                SVNIndexXSLT "/repos-web/view/repos.xsl"
        <Location /repos-web>
                DAV off

But http://svn.domain.com/repos-web simply returns:

Could not open the requested SVN filesystem

I tried changing the <Location /> in <LocationMatch "^/(?!repos-web)"> but this did not help at all.

Of course one solution would be to serve the xslt file over another domain/subdomain, but this is more a workaround than solution.

share|improve this question
up vote 1 down vote accepted

The main issue is that you cannot turn off Dav for a subfolder. So that's why most people enable Dav for a sublocation like /svn.

On the other hand, with some trickery, it can work if you use a rewrite rule and redirect to another domain which has the xsl files. You will need to set the Access-Control-Allow-Origin header on that other domain to say the original domain is ok. Something like:

<Location />
  Header append Access-Control-Allow-Origin http://www.example.com

Your rewrite rules on your main domain would look like:

<Location /repos-web>
  RewriteEngine On
  RewriteRule .*$ http://repos.example.com%{REQUEST_URI} [last,redirect]
share|improve this answer

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.