[Bug 70084] New: rewrite recipe for ACME challenge exemption failing

[email protected] Wed, 27 May 2026 23:58:52 +0000
Newsgroups gmane.comp.apache.documentation
Message-ID <[email protected]/bugzilla/>
https://bz.apache.org/bugzilla/show_bug.cgi?id=70084

            Bug ID: 70084
           Summary: rewrite recipe for ACME challenge exemption failing
           Product: Apache httpd-2
           Version: 2.5-HEAD
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Documentation
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

The (quite useful) recipe recently added to the rewrite documentation
<https://httpd.apache.org/docs/2.4/rewrite/remapping.html#acme-exemption> seems
to have an issue with the use of $0 in the RedirectMatch:

> RedirectMatch permanent "^/(?!\.well-known/acme-challenge/)" "https://www.example.com/$0"

First, we will get a double leading slash due to $0 already containing this in
the matched URL-path. Further - at least in my tests on Apache/2.4.66 (Debian)
- the variable does only contain the part that could actually matched against
the regex - in this case it is only "/" for "/anything".

To fix, I came up with one of the following expressions:

> RedirectMatch permanent "^/(?!\.well-known/acme-challenge/).*" "https://www.example.com$0"
> RedirectMatch permanent "^/(?!\.well-known/acme-challenge/)(.*)$" "https://www.example.com/$1"

-- 
You are receiving this mail because:
You are the assignee for the bug.