Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Redirection to HTTPS via web.config  (Read 3171 times)

0 Members and 1 Guest are viewing this topic.

sajugovind

  • Guest
Redirection to HTTPS via web.config
« on: July 26, 2014, 03:10:57 pm »
We can configure https redirection via web.config. Add below codes on web.config file under your root directory.

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

Thank you,