title: IIS rewrite rule to redirect https to http not working
body: <p>There's lots of questions here about redirecting http to https so I figured it would be easy to reverse the process. However, everything I've tried hasn't worked.</p>
  
  <p>I'm trying to combine the rule with my canonical host name rule (it's the first rule, at the top of the rewrite rules):</p>
  
  <pre><code>&lt;rule name="CanonicalHostName" stopProcessing="true"&gt;
    &lt;match url="(.*)" /&gt;
    &lt;conditions logicalGrouping="MatchAny"&gt;
      &lt;add input="{HTTPS}" pattern="^ON$" /&gt;
      &lt;add input="{HTTP_HOST}" negate="true" pattern="^www\.example\.com|example-staging\.azurewebsites\.net$" /&gt;
    &lt;/conditions&gt;
    &lt;action type="Redirect" url="http://www.example.com/{R:1}" redirectType="Permanent" /&gt;
  &lt;/rule&gt;
  </code></pre>
  
  <p>The site is hosted on Azure and DNS is with CloudFlare if that makes any difference, I'm sure it shouldn't.</p>
  
  <p>Any ideas what I'm doing wrong / might be preventing the https to http part of the rule working? (the host name part works fine)</p>