HTTP to HTTPS redirect : URL Rewrite in IIS 8 Windows Server 2012 Part 5 : SSL Certificate

Modified on 2017/05/10 15:24 by Administrator — Categorized as: OS

HTTP to HTTPS redirect : URL Rewrite in IIS 8 Windows Server 2012 Part 5 : SSL Certificate

https://youtu.be/U7USHit5mhY

http://www.jppinto.com/2010/03/automatically-redirect-http-requests-to-https-on-iis7-using-url-rewrite-2-0/

https://kr.godaddy.com/help/redirect-http-to-https-automatically-8828

https://www.sslshopper.com/iis7-redirect-http-to-https.html

Method 1 – Using Microsoft URL Rewrite Module

1. Install the Microsoft URL Rewrite Module

2. Install your SSL certificate in IIS 7 and bind it to your website

3. Make sure Require SSL is NOT checked under SSL Settings for your website (uncheck the boxes that are checked in this screenshot)

4. Using the following code in your web.config file automatically redirects visitors to the HTTPS version of your site:

<configuration>
<system.webServer>
<rewrite>
    <rules>
	<rule name="HTTP to HTTPS redirect" stopProcessing="true"> 
	<match url="(.*)" /> 
	<conditions> 
		<add input="{HTTPS}" pattern="off" ignoreCase="true" />
	</conditions> 
	<action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
        </rule>   
    </rules>
</rewrite>
</system.webServer>
</configuration>