mod_rewrite 优于 mod_alias / 排序和优先级

mod_rewrite 优于 mod_alias / 排序和优先级

在多服务器共享主机中,我使用这个

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

将所有 Let's Encrypt 请求重定向到一台服务器。

问题是:如果有人(客户;-))正在使用例如

RedirectPermanent / http://somewhereelse

RedirectPermanent 优先于 RedirectMatch(这是合乎逻辑的)。

所以我用以下规则取代了我的核心规则

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

但即使使用“L”标志,mod_alias(RedirectPermanent)也会执行。

是否有人看到任何机会来“修复”这个问题,以便我的中心规则可以随时执行?

顺便说一句:我也试图通过对文件名进行排序来确保“我的”规则是 apache 配置中的最后一条(也是第一条),但客户的 RedirectPermanent 总是

相关内容