How to protected SVN Directories with HTACCESS File
This line in the “.htaccess” file will protect all SVN directories (“.svn/”):

<IfModule mod_rewrite.c>
RewriteRule ^(.*/)?\.svn/ - [F,L]
IfModule>

The flag “F” means forbidden, and the “L” flag means the last rule to be used if this rule is used. “-” is used to not change the original request URI. ErrorDocument can also be used with the rule to display a custom error message: