Protecting your .git, .svn and .cvs directories in Apache

For many reasons you will want to prevent others from reading the content of your .git, .svn and/or .cvs directories.

In Apache, it is very simple to do.

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

That’s all.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.