<p>I want to keep my website/s in version control (Subversion specifically) and use <code>svn co</code> to update it when there are stable versions to update, but I'm concerned about the security of doing so, as all the <code>.svn</code> folders will be public, and these include all sorts of private data, not least of which is complete source code to my website! </p>

<p>Is there anything I can I do to prevent this?</p>

This can be achieved server-wide (recommended), on a single virtual-host basis, or even inside
```
.htaccess
```
files if your server is somewhat permissive with what is allowed in them. The specific configuration you need is:
```
```
RewriteEngine On
RewriteRule /\.svn /some-non-existant-404-causing-page

<IfModule autoindex_module>
    IndexIgnore .svn
</IfModule>
```
```
The first section requires
```
mod_rewrite
```
. It forces any requests with "/.svn" in them (ie. any request for the directory, or anything inside the directory) to be
internally
redirected to a non-existant page on your website. This is completely transparent to the end-user and undetectable. It also forces a 404 error, as if your
```
.svn
```
folders just disappeared.
The second section is purely cosmetic, and will hide the
```
.svn
```
folders from the autoindex module if it is activated. This is a good idea too, just to keep curious souls from getting any ideas.