0

UrlRewriteFilter用来转换example.comwww.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

4

1 回答 1

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>

于 2014-11-29T15:13:42.587 回答