【发布时间】:2014-10-05 11:43:30
【问题描述】:
我正在尝试进行从 http 到 https 的 301 重定向。
当我使用这个规则时,我得到一个无限循环重定向到https://localhost/mypage:
<rule>
<name>https redirect</name>
<condition name="scheme" operator="notequal">^https$</condition>
<from>^/(.*)</from>
<to type="permanent-redirect" last="true">https://localhost/$1</to>
</rule>
当我使用这个时,根本不会发生重定向
<rule>
<name>https redirect</name>
<condition name="scheme" operator="equal">^http$</condition>
<from>^/(.*)</from>
<to type="permanent-redirect" last="true">https://localhost/$1</to>
</rule>
由此我猜测我写的方案条件是错误的,但我找不到写规则的正确方法,我尝试了:
<condition name="scheme" operator="equal">^http$</condition>
<condition name="scheme" operator="equal">http</condition>
关于为什么这不起作用的任何线索?
【问题讨论】:
标签: java redirect https http-status-code-301 tuckey-urlrewrite-filter