-
-
Save devluis/6181468 to your computer and use it in GitHub Desktop.
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
# Make .git files and directory web inaccessible | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule ^(.*/)?\.git+ - [R=404,L] | |
</IfModule> | |
# Second line of defense (if no mod_rewrite) | |
RedirectMatch 404 ^(.*/)?\.git+ |
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
# Make .git files and directory web inaccessible | |
# Redirect it to the domain root | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule "^(.*/)?\.git/" http://%{HTTP_HOST}/? [L] | |
</IfModule> | |
# Second line of defense (if no mod_rewrite) | |
RedirectMatch 404 ^(.*/)?\.git+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment