Skip to content

Commit

Permalink
Update .htaccess and server script to allow access to .well-known
Browse files Browse the repository at this point in the history
  • Loading branch information
giuscris committed Nov 3, 2024
1 parent 9a1bd91 commit ff7d9b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ 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
RewriteRule ^(panel|backup|bin|cache|formwork|site|vendor)/.* index.php [L,NC]

## 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]
</IfModule>

## Disable access to directory indexes
Expand Down
3 changes: 2 additions & 1 deletion formwork/server.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ff7d9b4

Please sign in to comment.