Redirecting HTTP to HTTPS in IIS

To redirect HTTP requests to HTTPS in IIS, you can use the IIS URL Rewrite module. Here are the steps to follow:

  1. Download and install the IIS URL Rewrite module. https://www.iis.net/downloads/microsoft/url-rewrite

    To enable the IIS Rewrite Module, you can follow these steps:

    • Open your Internet Information Services (IIS) Manager.
    • Select any of your websites under Sites in the Connections panel.
    • Download the URL Rewrite Module for IIS 7 (and later), and follow the prompts to install the module.
    • Restart your IIS Manager, and you should now have the module available!
  2. Launch IIS Manager and select the website you want to apply redirection to.
  3. Double-click URL Rewrite and click Add Rule(s).
  4. Select Blank rule in the Inbound rules section and click OK.
  5. Give your redirect an easy-to-remember name.
  6. In the Matched URL section, set Requested URL to Matches the Pattern and set Using to Regular Expressions.
  7. Enter
    (.*)

    as the Pattern and check Ignore case.

  8. Scroll down to Conditions and expand the section if necessary.
  9. Select Match All for Logical grouping, then click the Add button.
  10. Type
    {HTTPS}

    in the Condition input field and set Check if input string to Matches the Pattern.

  11. Type
    ^OFF$

    in the Pattern field and check Ignore case.

  12. Click OK.
  13. Scroll down to the Action section and enter these settings:
    1. Select Redirect as the Action type.
    2. Type
      https://{HTTP_HOST}/{REQUEST_URI}

      in the Rewrite URL field.

    3. Uncheck Append query string.
    4. Set Redirect type to Permanent (301).
    5. Click Apply in the right-hand Actions menu.

These instructions assume that you’ve already taken the following steps with your site:

  1. Created your website in IIS
  2. Installed an SSL/TLS certificate
  3. Bound the certificate to your website

https://www.ssl.com/how-to/redirect-http-to-https-with-windows-iis-10/

https://www.namecheap.com/support/knowledgebase/article.aspx/9953/38/iis-redirect-http-to-https/

https://stackoverflow.com/questions/51063815/redirect-http-to-https-via-iis