Restricting .svn Access

<1 min read

I was looking for a way to restrict access to the Subversion administrative (.svn) directories in Apache/Tomcat. The instructions I found recommended using a DirectoryMatch directive which doesn't work with mod_jk.

Using a global LocationMatch directive seems to work:

<LocationMatch "^/.*/.svn/">
  Order deny,allow
  Deny from all
</LocationMatch>