Skip to content

Instantly share code, notes, and snippets.

@mitio
Created May 26, 2011 16:24
Show Gist options
  • Save mitio/993466 to your computer and use it in GitHub Desktop.
Save mitio/993466 to your computer and use it in GitHub Desktop.
Forbid accessing of .svn folders via HTTP
# Nginx
server {
# (...server definition skipped...)
location ~ "/\.svn" {
return 403;
}
}
# Apache's .htaccess
RewriteEngine On
<IfModule mod_rewrite.c>
RewriteRule ^(.*/)?\.svn/ - [F,L]
ErrorDocument 403 "403 Forbidden"
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment