RewriteEngine on RewriteBase / # block git repo RewriteRule ^.git/(.*) error [R=301,L] RewriteRule ^.gitattributes error [R=301,L] RewriteRule ^.gitignore error [R=301,L] RewriteRule ^.gitmodules error [R=301,L]