Created
November 6, 2012 01:10
-
-
Save stephenhowells/4021772 to your computer and use it in GitHub Desktop.
Apache conf snippet to hide .git directories and .gitignore files.
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
# do not allow .git version control files to be issued | |
<Directorymatch "^/.*/\.git+/"> | |
Order deny,allow | |
Deny from all | |
</Directorymatch> | |
<Files ~ "^\.git"> | |
Order allow,deny | |
Deny from all | |
</Files> |
The + matches one or more 't', which might not be what you had in mind. In any event, if you want to match the .git directory and .gitignore file you might consider a Directorymatch on "/.git/" and a Files without regex on ".gitignore"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
should be added into httpd.conf, not .htaccess