redirectmatch negative lookahead regex

I came across the folllowing redirect match for Apache on the following site: https://www.hyperborea.org/journal/2...-lets-encrypt/

Code:

RedirectMatch 301 ^(?!/\.well-known/acme-challenge/).* https://example.com$0

If I'm not mistaken, this is a negative lookahead regex, right? The question is, why would someone need something so complex in this case?
Or wouldn't it work otherwise with a RedirectMatch?
Presumably because a negative explicit case is easier to come up with than a positive general case that just happens to exclude the specific negative case.

Topic archived. No new replies allowed.