2

Within a multi-server shared hosting I am using this

RedirectMatch temp "/.well-known/acme-challenge/(.*)" "https://FOO.BAR.TLD/$1"

to redirect all Let's Encrypt requests to one server.

The problem: If someone (customer ;-) ) is using e.g.

RedirectPermanent / http://somewhereelse

the RedirectPermanent takes precedence over RedirectMatch (which is logical).

So I replaced my central rule with

RewriteEngine On
RewriteRule "^/.well-known/acme-challenge/(.*)" "https://FOO.BAR.TLD/$1" [L,R=302]

but even with the "L"-Flag, mod_alias (RedirectPermanent) is getting executed.

Does anyone see any chance to "fix" this so that my central rule is getting executed at any time?

BTW: I also tried to ensure that "my" rule is the last one (and the first one) in apache config by ordering file names, but the RedirectPermanent of the customer alwa

Schubi Duah
  • 151
  • 2
  • 1
    The order in which Apache handles various Directives is a very complicated, case-by-case determination based on not only the placement of Directives in your configuration file, but on the handling order specified by the relevant modules as well as the [Apache merging rules](http://httpd.apache.org/docs/2.4/sections.html#merging). – Colt Jan 02 '18 at 07:26
  • "If someone (customer ;-) ) is using..." - are you referring to the "customers" use of `.htaccess` here? In what _context_ (Server, VirtualHost or Directory) are you placing this directive in the server config? – MrWhite Jan 02 '18 at 15:59
  • I am using "my" global configuration in Server context, but even when placing in VirtualHost or Directory, the "RedirectPermanent" done by the customer always takes priority over everything. – Schubi Duah Jan 03 '18 at 06:39

0 Answers0