How to auto redirect Website HTTP traffic to HTTPS

Question: How to auto redirect Website HTTP traffic to HTTPS
 
Answer:
We will use “Microsoft URL Rewrite Module (download URL)” for auto re-routing web HTTP request to HTTPS.
 
  • Open IIS Manager and select the website > URL Rewrite [Make sure SSL certificate is already applied on this website]
     
 
 
  • Add a blank Rule

 
  • Give any name to the rule such as "HTTPS"
    Pattern: (.*)
 
 
  • Under Conditions Tab > click on Add and insert exactly the same values as below
    Condition Input: {HTTPS}
    Check if input string: Matches the Pattern
    Pattern: ^OFF$
 
  • Under Action Tab select and insert exactly the same as below
    Action Type: Redirect
    Redirect URL: https://{HTTP_HOST}/{R:1}
    Redirect Type: see other (303)