title: How to redirect HTTP to HTTPS in MVC application (IIS7.5)
body: <p>I need to redirect my HTTP site to HTTPS, have added below rule but I am getting 403 Error when tried using <a href="http://www.example.com" rel="noreferrer">http://www.example.com</a>, it works fine when I type <a href="https://www.example.com" rel="noreferrer">https://www.example.com</a> in browser. </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;system.webServer&gt;
      &lt;rewrite&gt;
          &lt;rules&gt;
              &lt;rule name="HTTP to HTTPS redirect" stopProcessing="true"&gt;
                  &lt;match url="(.*)" /&gt;
                  &lt;conditions&gt;
                      &lt;add input="{HTTPS}" pattern="off" ignoreCase="true" /&gt;
                  &lt;/conditions&gt;
                  &lt;action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" /&gt;
              &lt;/rule&gt;
          &lt;/rules&gt;
      &lt;/rewrite&gt;
  &lt;/system.webServer&gt;
  </code></pre>