Created
September 28, 2020 17:11
-
-
Save mateuslopes/3dcf4b3caf4c29eecf5616570de9d275 to your computer and use it in GitHub Desktop.
Block access .git folders and files on Apache2 servers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this into your httpd.conf to block access to any server .git folders and files | |
<DirectoryMatch "^/.*/\.git+/"> | |
Order deny,allow | |
Deny from all | |
</DirectoryMatch> | |
<Files ~ "^\.git"> | |
Order allow,deny | |
Deny from all | |
</Files> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment