From ff7d9b4a70f074d785f45117887316f3911f0007 Mon Sep 17 00:00:00 2001 From: Giuseppe Criscione <18699708+giuscris@users.noreply.github.com> Date: Sun, 3 Nov 2024 14:10:29 +0100 Subject: [PATCH] Update .htaccess and server script to allow access to .well-known --- .htaccess | 4 ++-- formwork/server.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.htaccess b/.htaccess index 3f1d35a3..1f59ebba 100644 --- a/.htaccess +++ b/.htaccess @@ -10,7 +10,6 @@ AddDefaultCharset utf-8 ## Let all URI be processed by index.php RewriteCond %{REQUEST_FILENAME} !-f - RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^.* index.php [L] ## Prevent direct access to Formwork folders @@ -18,7 +17,8 @@ AddDefaultCharset utf-8 ## Prevent access to specific files RewriteRule ^(.*)\.(md|yml|yaml|json|neon)/?$ index.php [L,NC] - RewriteRule ^(\.(.*)|LICENSE|composer\.lock)/?$ index.php [L,NC] + RewriteRule ^(LICENSE|composer\.lock)/?$ index.php [L,NC] + RewriteRule (^|/)\.(?!well-known)/? index.php [L,NC] ## Disable access to directory indexes diff --git a/formwork/server.php b/formwork/server.php index 3c41fac3..2002e6f5 100644 --- a/formwork/server.php +++ b/formwork/server.php @@ -8,7 +8,8 @@ switch (true) { case preg_match('~^/(panel|backup|bin|cache|formwork|site|vendor)/.*~i', $path): case preg_match('~^/(.*)\.(md|yml|yaml|json|neon)/?$~i', $path): - case preg_match('~^/(\.(.*)|LICENSE|composer\.lock)/?$~i', $path): + case preg_match('~^/(LICENSE|composer\.lock)/?$~i', $path): + case preg_match('~(^|/)\.(?!well-known)/?~i', $path): break; default: