Setting Up HTTP to HTTPS Redirect in IIS

Author:Esadax
Updated:Jul 19, 2025

To configure an HTTPS redirect using IIS, follow these steps:

  1. Enable URL Rewrite Module: Ensure the "URL Rewrite" module is enabled in IIS.

  2. Create a New Redirect Rule:

    • Name: Enter a name for your rule (e.g., "HTTPS Redirect").
    • Action Type: Select "Redirect".
  3. Set Match URL: Use '*' or (.*) to match all incoming requests.

  4. Add Condition:

    • Input String: {HTTPS}
    • Pattern: ^OFF$
    • This condition triggers the redirect when HTTPS is not present (i.e., when using HTTP).
  5. Redirect URL: Set to https://{HTTP_HOST}{REQUEST_URI} to maintain the correct domain and path.

  6. Redirect Type: Choose "Permanent" (301) for a permanent redirect, beneficial for SEO.

  7. Append Query String: Check the box to preserve existing query parameters during redirection.

  8. Apply Changes: Save the rule and test by accessing your site via HTTP to ensure it redirects correctly to HTTPS.

  9. Verify Configuration:

    • Check the web.config file in the document root for the XML configuration.
    • If missing, create a new file with the necessary XML content.