-
-
Save brainv/50fbde1385fb0f1cbbeafadbc90a1094 to your computer and use it in GitHub Desktop.
Block hidden files except .well-known - Apache .htaccess + Nginx
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
RewriteRule "(^|/)\.(?!well-known\/)" - [F] |
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
location ~ /\.(?!well-known\/) { | |
deny all; | |
} |
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
<Directory ~ "/\.(?!well-known\/)"> | |
Order deny,allow | |
Deny from all | |
</Directory> |
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
<Directory ~ "/\.(?!well-known\/)"> | |
Require all denied | |
</Directory> |
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
status 403 /blockdot | |
rewrite { | |
r /\.(?!well-known\/) | |
to /blockdot | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment