Home > DeveloperSection > Articles > Redirecting from HTTP to HTTPS

Redirecting from HTTP to HTTPS

ASP.Net ASP.Net 
0 Comment(s)
 1944  View(s)
Rate this:

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.

Don't want to miss updates? Please click the below button!

Follow MindStick