Block access to .svn folders

Here are three ways in Apache to block access to the .svn folders.

With access controls:

<Directory ~ "\.svn">
Order allow,deny
Deny from all
</Directory>

With rewrite rule:

RewriteRule ^(.*/)?\\.svn/ - [F,L]

With redirect:

RedirectMatch 404 /\\.svn(/|$)

These come from the excellent MDLog:/sysadmin blog at:

http://www.ducea.com/2006/08/11/apache-tips-tricks-deny-access-to-some-folders/

  • Jo

    That is another option:

    Deny from all

blog comments powered by Disqus