Apache 2.2 mod_alias的RedirectMatch有什么问题?

我们使用Apache HTTPD服务器版本2.2。 我尝试使用Apache 2.2的mod_alias RedirectMatch没有成功( http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirectmatch )

例如,我需要创build一个只redirectURL参数change_url=1的规则

 https://<IP>/servlet1?id=1&type=2&change_url=1 

我曾尝试使用以下规则:

 RedirectMatch (.*)change_url=1(.*) /keepurlprocess/$1 

不幸的是,只有当URL中的change_url

 https://<IP>/change_url=1 

我的正则expression式有什么问题? 如何应用它来查询参数? 另外,我有一些特定的参数type 。 对于某些types,我不需要执行redirect:

 https://<IP>/servlet1?id=1&type=do_not_redirect&change_url=1 

是否有可能创build像下面的规则?

 RedirectMatch (.*)(change_url=1 AND NOT type=do_not_redirect)(.*) /keepurlprocess/$1 

看看这里。 您应该能够在IF语句中删除redirect

https://httpd.apache.org/docs/2.4/mod/core.html#if