我正在使用UrlRewriteFilter
将example.com
转换为www.example.com
<urlrewrite>
<rule>
<name>Canonical Hostnames</name>
<condition name="host" operator="notequal">^example.com</condition>
<condition name="host" operator="notequal">^$</condition>
<from>^/(.*)</from>
<to type="redirect" last="true">http://www.example.com/$1</to>
</rule>
</urlrewrite>
当我浏览example.com
浏览器时显示This webpage has a redirect loop
答案 0 :(得分:0)
<condition name="host" operator="notequal">^example.com</condition>
将以上内容之一替换为
<condition name="host" operator="equal">^example\.com</condition>
<condition name="host" operator="notequal">^www\.example\.com</condition>