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.
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