using UrlRewriteFilter shows This webpage has a redirect loop

251 Views Asked by At

I am using UrlRewriteFilter to convert example.com to 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>

When i browse example.com browser shows This webpage has a redirect loop

1

There are 1 best solutions below

1
On BEST ANSWER

<condition name="host" operator="notequal">^example.com</condition>

Replace the above with one of the following

<condition name="host" operator="equal">^example\.com</condition>

<condition name="host" operator="notequal">^www\.example\.com</condition>