Thursday, August 21, 2014

HTTP to HTTPS Redirector / IIS URL Rewriter / IIS 8.0

Redirecting all traffic from HTTP to HTTPS in IIS7 will make sure your users always access the site securely.

Method – 1
Install URL Rewrite module 2.0 (Latest @ this time)
This is a add ins for IIS will allows you to manipulate URL’s.
You can download it from :

 How to Add a URL rewrite rule

Rule Name: Redirects to HTTPS
Pattern: (.*)
Add Condition: {HTTPS}
Check if input string: Matches the Pattern
Pattern: ^OFF$
Tick this - Ignore case
Action type: Redirect
Redirect URL: https://{HTTPS_HOST}/{R:1} 
Tick this - Append query string
Redirect type: See Other (303)

Method – 2
By inserting the following code in to the web.config file located “C:\inetpub\wwwroot”
 
Thanks
-Roshan