yes i love technology

Keep scummers out of your .svn directories

January 26th, 2007 by Pete

If your a website developer or designer then you don't want to be editing the files on your live webserver if you can help it. One of the best way around this is to do your development work on a local machine and check your files into a version control system such as Subversion.

However when you checkout files from subversion .svn directories are created in each folder you checkout. If you don't do anything nosey Internet scummers can go poking about in your .svn directory and learn all sorts of things, so keep them out with a nice bit of Apache mod_rewrite.

CODE:
  1. # keep out scummers  from .svn directories
  2. RewriteEngine On
  3. RewriteRule ^(.*/)*\.svn/ / [F,L]

If your mod_rewrite mad your likely to love this cheat sheet. Official mod_rewrite information can be found here.

The alternative to checking out files is to export from subversion. If you export
.svn folders will not be created, however exporting is a one off operation where all files are copied. If you checkout from Subversion you can then update each time new changes are made, updating will only modify the changed files, so it's fast.

If you want to find out more about Subversion this PDF book is a great resource.

/* Pete Graham */

Posted in Tech, mod_rewrite, subversion, svn | 1 Comment »