Skip to main content

Automatically redirect http to https

Open your web.config file and add the following section inside the system.webserver tag
<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>
view raw web.config hosted with ❤ by GitHub
Now your website will automatically redirect to https

Comments