Skip to content

Instantly share code, notes, and snippets.

Last active May 22, 2023 06:54
What would you like to do?
Block hidden files except .well-known - Apache .htaccess + Nginx
RewriteRule "(^|/)\.(?!well-known\/)" - [F]
location ~ /\.(?!well-known\/) {
deny all;
<Directory ~ "/\.(?!well-known\/)">
Order deny,allow
Deny from all
<Directory ~ "/\.(?!well-known\/)">
Require all denied
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