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
Steps for IIS Redirect HTTP to HTTPS
2. Open IIS Manager, in the console select the website you want to redirect
3. Select URL Rewrite
5.Select Blank Rule, click OK
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: “(.*)”
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
13.Check the Append Query String box
14. Choose your redirection type (301)
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
3. Make sure the file contains the following code block (if not, add it)
<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>
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.
95%OFF
Comodo Positive SSL
78%OFF
RapidSSL Certificate
95%OFF