Get your FREE copy of "The Ultimate Guide of SSL"

Download Ebook

IIS Redirect HTTP to HTTPS : Enabling the HTTPS Redirection in IIS

Step-by-Step Instructions for using a URL Rewrite to Redirect HTTP to HTTPS in IIS

Before you can set out with an HTTP/HTTPS redirect in IIS, you’ll need to make sure that you have an SSL certificate already installed. This is not a step you can skip. Once you’ve got the certificate installed, we can start working on a URL rewrite to redirect your traffic to your new-fangled HTTPS site.

Steps for IIS Redirect HTTP to HTTPS

1. Download and install the IIS URL Rewrite Module

2. Open IIS Manager, in the console select the website you want to redirect

3. Select URL Rewrite

4. Click Add Rules

5.Select Blank Rule, click OK

6. Enter the Name of rule

7. In the Match URL section choose “Matches the Pattern” in the Requested URL drop-down

8. Next select “Regular Expressions” in the Using drop-down

9. In the Match URL section enter: “(.*)

10. In the conditions section, select Match All under Logical Grouping, the click Add
11. In the next window: 

  • Enter {HTTPS} as the condition input
  • Select “Matches and Pattern” from the drop-down
  • Enter ^OFF$ as the pattern
  • Click OK
12. In the Action section, click Redirect and then specify the Redirect URL as: https://{HTTP_HOST}/{R:1}

13.Check the Append Query String box

14. Choose your redirection type (301)

15. Click Apply

Next, you’ll have to apply the rule to your website.

Setting up IIS HTTP to HTTPS Redirect Rules

1. In the IIS dashboard, right click on your site and select Explore

2. Your Root Directory will open, select the web.config file and open it

3. Make sure the file contains the following code block (if not, add it)

<rule name=”HTTPS force” enabled=”true” stopProcessing=”true”>
<match url=”(.*)” />
<add input=”{HTTPS}” pattern=”^OFF$” />
<action type=”Redirect” url=”https://{HTTP_HOST}/{R:1}” redirectType=”Permanent” />

4. If you haven’t web.config file in your root directory, create new .txt file, just place the above code in it, save and then rename the file to web.config.

Note: These above steps to redirecting IIS from HTTP to HTTPS works with IIS 5, 6, 7, 8, 8.5, and IIS 10.



Comodo Positive SSL


Vendor Price: $41.73

Coupon Code: ASCSCPSSL4

Get It Now



RapidSSL Certificate


Vendor Price: $69

Coupon Code: ASRSRSSL2

Get It Now



Comodo PositiveSSL Multi-Domain

$17.54 – 2 SAN Included

Vendor Price: $41.73

Coupon Code: ASCSCPMD4

Get It Now

Important Articles:

Disclosure: AboutSSL appreciates your continuous support. It helps us tremendously to keep moving in the competitive SSL industry. Here most of the links which direct you to buy any SSL/TLS related service or products earns us a certain percentage of referral commission. Learn More