title: HTTPS redirect rewrite rule not working in IIS
body: <p>Our website, hosted in IIS 10, is covered by a valid SSL certificate. It works fine under the https version of the address.</p>
  
  <p>To catch the http traffic and redirect it, I added a rewrite rule in the web.config, as follows:</p>
  
  <pre><code>&lt;rule name="Redirect to http" enabled="true" patternSyntax="Wildcard" stopProcessing="true"&gt;
      &lt;match url="(.*)" negate="false" /&gt;
      &lt;conditions logicalGrouping="MatchAll"&gt;
                  &lt;add input="{HTTPS}" pattern="^OFF$" /&gt;
      &lt;/conditions&gt;
      &lt;action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" /&gt;
  &lt;/rule&gt;
  </code></pre>
  
  <p>I'd used this before and expected it to work fine. However on this server, it doesn't seem to function. Trying to reach the site on http yields an ERR_EMPTY_RESPONSE error.</p>
  
  <p>I searched through a bunch of tutorials, most of which seemed to support the rewrite I'd got. However, I did find and try this slightly different version</p>
  
  <pre><code>&lt;rule name="Redirect to http" enabled="true" patternSyntax="Wildcard" stopProcessing="true"&gt;
      &lt;match url="(.*)" /&gt;
      &lt;conditions logicalGrouping="MatchAny"&gt;
        &lt;add input="{SERVER_PORT_SECURE}" pattern="^0$" /&gt;
      &lt;/conditions&gt;
      &lt;action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" /&gt;
  &lt;/rule&gt;
  </code></pre>
  
  <p>But that didn't work either with the same ERR_EMPTY_RESPONSE to http.</p>
  
  <p>The site is bound to https via the host name on 443, and has a binding on port 80 with an empty host name. </p>
  
  <p>Other rewrite rules such as an IP-based access whitelist seem to be working fine, so it's unlikely to be an issue with the rewrite module. </p>
  
  <p>At a loss as to what I'm doing wrong?</p>