Here is how to force an ASP.NET Web Application to use HTTPS instead of HTTP (assuming you have a certificate installed).

Modify Web.config, in the <system.webServer> section, add:

    <rewrite>
      <rules>
        <rule name="HTTP to HTTPS redirect" stopProcessing="true">
          <match url="(.*)" />
          <conditions>
            <add input="{HTTPS}" pattern="off" ignoreCase="true" />
            <add input="{HTTP_HOST}" pattern="localhost" negate="true" />
          </conditions>
          <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
        </rule>
      </rules>
     </rewrite>
  </system.webServer>
  <runtime>

Thanks to: Paul S.