]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Fix RedirectMatch regex in ACME exemption recipe (bug 70084)
authorRich Bowen <rbowen@apache.org>
Tue, 2 Jun 2026 12:56:14 +0000 (12:56 +0000)
committerRich Bowen <rbowen@apache.org>
Tue, 2 Jun 2026 12:56:14 +0000 (12:56 +0000)
The negative lookahead (?!...) is zero-width and non-capturing, so
the original pattern matched only the leading slash and \$1 was
undefined. Add a capturing group (.*)$ after the lookahead so that
\$1 contains the remainder of the URL-path.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934878 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/rewrite/remapping.xml

index 5d54b142a4182132d369c197eb15128cd2bc3271..d528ff22266e496e5924b7c48829292adf450c74 100644 (file)
@@ -221,7 +221,7 @@ RewriteRule "^(.*)" "https://%{SERVER_NAME}$1" [R=301,L]
     &lt;/Directory&gt;
 
     # Everything else goes to HTTPS
-    RedirectMatch permanent "^/(?!\.well-known/acme-challenge/)" "https://www.example.com/$1"
+    RedirectMatch permanent "^/(?!\.well-known/acme-challenge/)(.*)$" "https://www.example.com/$1"
 &lt;/VirtualHost&gt;
 </highlight>