(5 votes, average: 4.40 out of 5)
Loading...
Before you start the HTTP to HTTPS redirection process within your IIS server, you’ll need to ensure that you have purchased trusted SSL/TLS certificate and installed correctly, and for the same, you can use the SSL checker tool.
Once the SSL certificate is installed, you’ll need to work on a URL rewrite to redirect your website traffic to your newly installed SSL site.
Once you complete the above steps, you’ll require to apply the rule to your website. So, HTTP URLs automatically get redirected to HTTPS. Hence, below are the steps for the same:
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=”HTTPS force” enabled=”true” stopProcessing=”true”>
<match url=”(.*)” />
<conditions>
<add input=”{HTTPS}” pattern=”^OFF$” />
</conditions>
<action type=”Redirect” url=”https://{HTTP_HOST}/{R:1}” redirectType=”Permanent” />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
And, if you still need to configure your web.config file within the root directory, create a new.txt file, place the code mentioned above within it, and save it with the name web.config.
Note:
Above mentioned steps are for redirecting IIS server traffic from HTTP to HTTPS. Similarly, it works for IIS servers 5, 6, 7, 8, 8.5, and IIS 10.
Secure your primary domain and unlimited subdomains with premium 256bit SSL encryption on multiple servers with a single Premium Wildcard SSL.