java – UrlRewriteFilter直接到https
发布时间:2020-05-28 13:59:26 所属栏目:Java 来源:互联网
导读:我正在使用UrlRewriteFilter重定向到SSL.我正在运行Glassfishv2. 我的规则现在看起来像这样.它位于我的war文件夹的WEB-INF中的urlrewrite.xml中.还有其他需要设置的玻璃鱼吗? rule condition name=host operator=notequalhttps://abc.def.com/condition
|
我正在使用UrlRewriteFilter重定向到SSL.我正在运行Glassfishv2. 我的规则现在看起来像这样.它位于我的war文件夹的WEB-INF中的urlrewrite.xml中.还有其他需要设置的玻璃鱼吗? <rule>
<condition name="host" operator="notequal">https://abc.def.com</condition>
<condition name="host" operator="notequal">^$</condition>
<from>^/(.*)</from>
<to type="permanent-redirect" last="true">https://abc.def.com/ghi/$1</to>
</rule>
但FF一直说URL重定向规则是永远不会完成的.我不确定这里发生了什么.有任何想法吗? 解决方法我怀疑问题是主机头(您要比较的)的值不包含用于访问资源的方案,您的比较值就是这样.这意味着条件始终为真,因为主机永远不会与您比较它的内容相等,从而导致无限重定向循环.查看UrlRewriteFilter的文档,您应该可以执行以下操作来获得所需内容: <rule>
<condition type="scheme" operator="notequal">https</condition>
<condition name="host" operator="equal">abc.def.com</condition>
<from>^/(.*)</from>
<to type="permanent-redirect" last="true">https://abc.def.com/ghi/$1</to>
</rule> (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
