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

I would like to know if it's unsecure to leave the .svn folders accessible to anyone on a webserver

eg. :

if not what's the best way to secure these?

share|improve this question
up vote 5 down vote accepted

SVN export is a better answer for most people. Metadata leaks could be problematic in some cases, but if anyone was really surprised by them they didn't read the fine manual and should be scolded. For the rest, I'm using this in .htaccess and it seems to work okay:

## Need to tell apache2 to ignore .svn ... ?
RedirectMatch 403 /\\.svn(/|$)
share|improve this answer
thanks is it also working for lighttpd? – mnml Oct 5 '09 at 23:03

This has shown to be a security hole, and hackers have been able to view the source of some sites this way.

Typically for sites in a production environment you should use a svn export instead of a checkout.

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.