Last active
August 12, 2024 09:18
-
-
Save lynt-smitka/1ce5c4bb3a8d251df0b3268019787664 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
Thanks