How to disallow browsing of .svn directories on your server


If you deploy projects live out of Subversion repositories to public web servers, here’s a good tip for denying access to the .svn directories to keep people from snooping around your files.

Edit your global Apache config file (httpd.conf) or .htaccess file to include the following directive:


# Disallow any .svn directory browsing
<directory ~ "\.svn">
Order allow,deny
Deny from all
</directory>

This will tell apache to not serve up any directories that are called .svn.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

sell diamonds