-
-
Save defrindr/ae040c5e72bc994ed60b611473b212db 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