Admin-Ahead Community

Windows => General Windows => Topic started by: sajugovind on July 26, 2014, 03:10:57 pm

Title: Redirection to HTTPS via web.config
Post by: sajugovind 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,