Hide .git repo with Apache
Snippet
Instead of being asleep at 13:11 on 14 August 2018, kitt created this:
Solution 2.
Don't allow apache to serve anything from the .git
repo that might be in the DocumentRoot
. This is great because it hides that there even IS a git repo on the webserver.
Add this to the .htaccess in the DocumentRoot
after the RewriteEngine On
line.
RedirectMatch 404 /\.git
Add new comment