title: Rewriting URLs from https:// to http:// in IIS7
body: <p>I'm trying to rewrite urls from the form:</p>
  
  <pre><code>https://example.com/about
  </code></pre>
  
  <p>to the form</p>
  
  <pre><code>http://example.com/about
  </code></pre>
  
  <p>using <a href="http://www.iis.net/extensions/URLRewrite" rel="noreferrer">IIS7 URL rewriting</a>: </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;!-- http:// to https:// rule --&gt;
  &lt;rule name="ForceHttpsBilling" stopProcessing="true"&gt;
    &lt;match url="(.*)billing/(.*)" ignoreCase="true" /&gt;
    &lt;conditions&gt;
      &lt;add input="{HTTPS}" pattern="off" ignoreCase="false" /&gt;
    &lt;/conditions&gt;
    &lt;action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}{REQUEST_URI}" /&gt;
  &lt;/rule&gt;
  
  &lt;!-- https:// to http:// rule --&gt;    
  &lt;rule name="ForceNonHttps" stopProcessing="true"&gt;
    &lt;match url="(.*)billing/(.*)" ignoreCase="true" negate="true" /&gt;
    &lt;conditions&gt;
        &lt;add input="{SERVER_PORT}" pattern="^443$" /&gt;
    &lt;/conditions&gt;
    &lt;action type="Redirect" redirectType="Found" url="http://{HTTP_HOST}{REQUEST_URI}" /&gt;
  &lt;/rule&gt;
  </code></pre>
  
  <p><s>I'm at a loss; I've been browsing the web for examples and trying every syntax I can think of. The rewrite rules I specify simply don't appear to work <i>at all</i> for any https requests, as if all the <code>https://</code> requests are flat out invisible to the rewrite engine. </s></p>
  
  <p>rules work fine; see answer below.</p>