I am new to IIS and trying to translate into it the following Apache rule:
# prevent httpd from serving dotfiles (.htaccess, .svn, .git, etc.)
# - except let's encrypt challenge
RedirectMatch 403 ^/?\.(?!/well-known/acme-challenge/[\w-]{43}$)
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
The idea of the rule is prevent IIS from serving:
Any file than starts with “.”, or
Any folder that starts with “.” but the folder “./well-known/acme-challenge”
Thanks in advance ;)