title: canonical hostname rule with multiple domains
body: <p>I have this code</p>
  
  <pre><code>&lt;rule name="CanonicalHostNameRule1"&gt;
  &lt;match url="(.*)" /&gt;
  &lt;conditions&gt;
  &lt;add input="{HTTP_HOST}" pattern="^www\.domain\.com\.au$" negate="true" /&gt;
  &lt;/conditions&gt;
  &lt;action type="Redirect" url="http://www.domain.com.au/{R:1}" /&gt;
  &lt;/rule&gt;
  
  &lt;rule name="CanonicalHostNameRule2"&gt;
  &lt;match url="(.*)" /&gt;
  &lt;conditions&gt;
  &lt;add input="{HTTP_HOST}" pattern="^www\.domain\.co\.nz$" negate="true" /&gt;
  &lt;/conditions&gt;
  &lt;action type="Redirect" url="http://www.domain.co.nz/{R:1}" /&gt;
  &lt;/rule&gt;
  </code></pre>
  
  <p>When i run this i get "This webpage has a redirect loop" Seems like NZ redirects to AU for some reason.</p>
  
  <p>UPDATE</p>
  
  <p>This seems to work</p>
  
  <pre><code>&lt;rule name="RedirectToWWW" stopProcessing="true"&gt;
    &lt;match url=".*" /&gt;
    &lt;conditions logicalGrouping="MatchAll"&gt;
      &lt;add input="{HTTP_HOST}" pattern="^(?!www)(\S+)\.(co(\.nz)?|com\.au)$" /&gt;
    &lt;/conditions&gt;
    &lt;action type="Redirect" url="http://www.{C:0}/{R:0}" /&gt;
  &lt;/rule&gt;
  </code></pre>