Redirecting from HTTP to HTTPS

Redirecting from http to https is a common issue now days. Https is the secure protocol to go ahead in the requirement of payment sides or payment gateway integration.

So here I am going to explain you guys a very simple way to redirect you web address from http to https.

Prerequisites:  First of all you need to have a SSL certificate and it should be installed in your IIS server. You also need to keep in mind the URL rewrite functionality is available in IIS 7 and higher versions.

Implementation:   To achieve the redirection from http to https you need to include below code in your web.config file under the <system.webserver> tag.



<rule name="HTTP to HTTPS redirect" stopProcessing="true">

  <match url="(.*)" />


      <add input="{HTTPS}" pattern="off" ignoreCase="true" />


  <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />




I hope it will help someone in achieving the same.

  Modified On Nov-28-2017 06:17:33 AM

Leave Comment