mod_redirect模块里可以使用res_code_in的条件语句吗,因为使用req_path_prefix_in可以重定向,但使用res_code_in不行? #1024
Answered
by
iyangsj
zhhOceanfly
asked this question in
Q&A (问题和回答)
-
Beta Was this translation helpful? Give feedback.
Answered by
iyangsj
Mar 11, 2022
Replies: 2 comments 1 reply
-
还有一个问题,如果mod_rewrite和mod_redirect两个都配置了,试验了下会优先走mod_redirect这个模块,是这样理解的吗 |
Beta Was this translation helpful? Give feedback.
1 reply
-
@zhhOceanfly 不可以。 因为这样的用法不对,BFE重定向模块在执行时,请求并未转发给后端。此时与响应相关的条件原语均返回false 如果真实需求是:当后端返回的响应满足某种条件(例如5xx错误),对响应进行修改替换为自定义的响应(例如改为302响应), |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mileszhang2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@zhhOceanfly 不可以。
因为这样的用法不对,BFE重定向模块在执行时,请求并未转发给后端。此时与响应相关的条件原语均返回false
如果真实需求是:当后端返回的响应满足某种条件(例如5xx错误),对响应进行修改替换为自定义的响应(例如改为302响应),
可以使用mod_errors 模块对将响应进行修改替换为自定义的响应。