From a083e02d02500229c94c30686e21331e7d4b9dd5 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 11 Mar 2026 12:29:57 -0400 Subject: [PATCH 1/3] refactor(.htaccess): re-order deny rules Mostly for clarity, but technically a micro-optimization too. Signed-off-by: Josh --- .htaccess | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/.htaccess b/.htaccess index db4f32a1fbb4a..ec75dfc9ad272 100644 --- a/.htaccess +++ b/.htaccess @@ -113,6 +113,13 @@ RewriteCond %{HTTP_USER_AGENT} DavClnt RewriteRule ^$ /remote.php/webdav/ [L,R=302] +## +## Rule: Prevent access to various non-public files +## + + RewriteRule ^(?:build/.*|tests/.*|config/.*|lib/.*|3rdparty/.*|templates/.*)$ - [R=404,L] + RewriteRule ^(?:autotest.*|occ.*|issue.*|indie.*|db_.*|console.*)$ - [R=404,L] + ## ## Rule: Map the RFC 8615 / RFC 6764 compliant well-known URI for CardDAV to our Remote DAV endpoint ## @@ -126,33 +133,36 @@ RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L] ## -## Rule: Map /remote* --> /remote.php* including the query string +## Rule: Maps most RFC 8615 compliant well-known URIs to our main frontend controller (/index.php) by default ## ## Context: +## - Intentionally excludes URIs used for HTTPS certificate verifications +## - RFC 8555 / ACME HTTP Challenges (acme-challenge) +## - File-based Validations (pki-validation) ## - XXX: `QSA` seems unnecessary (no-op) here (query string is passed by default when the replacement URI doesn't contain a query string) -## - XXX: Is this even used anymore? Seems a relic from