Skip to content
INSIGHTS & GUIDES · NETCLOUD24

How to Configure an IIS HTTP to HTTPS Redirect

Read the article ↓
Editorial illustration: How to Configure an IIS HTTP to HTTPS Redirect

An HTTP-to-HTTPS redirect should send visitors to a working secure endpoint while retaining the intended page and query string. Applying a redirect indiscriminately to a site that also serves HTTPS can create a loop, so separate the redirection scope from the protected application.

Make HTTPS work before redirecting users

Configure the production HTTPS binding, certificate and application first. Test the real hostname from a representative client and confirm the certificate name, trust chain and renewal responsibility. A redirect does not fix an invalid certificate and cannot make a broken HTTPS application usable.

Identify whether IIS, a reverse proxy or a load balancer owns the public redirect. When TLS terminates upstream, IIS may receive an HTTP request even though the visitor used HTTPS. A redirect condition that ignores that topology can loop. Keep a single documented place responsible for canonical scheme and host handling.

Use an HTTP-only redirect site for a simple IIS deployment

For a direct IIS deployment, create or designate a small redirect site bound only to HTTP for the approved hostname. Keep the business application’s HTTPS binding on its own site. Confirm that the redirect site cannot also match the target HTTPS request.

Install the HTTP Redirection role service if you choose the built-in feature. Back up IIS configuration and record site bindings before changing them. Do not introduce a wildcard host binding that steals unrelated sites on a shared server.

Configure and pilot the redirect

In the HTTP-only site’s HTTP Redirect feature, set the approved HTTPS destination. Choose the response status and path-handling options according to the application. Use a temporary redirect during initial testing if you do not yet want browsers to cache a permanent decision; move to the approved permanent status only after validation.

Do not select an exact-destination option without checking its effect on child paths. The requirement is usually to move a visitor from the same HTTP page to its HTTPS counterpart, not collapse every deep link onto the homepage. Test query strings and encoded paths used by the application.

Test a chain, not just a homepage

Check a normal page, a deep article or application path, a query-string URL and any health-check endpoint. Confirm the response code and Location header, then follow the destination and verify that the chain stops at the intended secure page. Check that a direct HTTPS request is not redirected back to itself.

Be cautious with API clients and form submissions: clients can handle redirect methods differently, and a cached permanent redirect can persist after configuration is rolled back. Choose the application’s supported behaviour rather than assuming all traffic is a browser GET.

curl.exe -I "http://www.contoso.example/reports/view?id=42"
curl.exe -I "https://www.contoso.example/reports/view?id=42"
curl.exe -I -L --max-redirs 5 "http://www.contoso.example/reports/view?id=42"

Monitor and reverse the scoped change if needed

Watch request logs for loops, unexpected destinations and health-check failures after the pilot. If rollback is necessary, disable the redirect on the HTTP-only site or restore its recorded settings without overwriting unrelated application configuration. Re-test both the HTTP and HTTPS entry points.

HSTS is a separate policy with its own persistence and rollout implications. Enable it only after all required HTTPS hosts and subdomains meet the intended policy. It should not be used to hide an incomplete redirect or certificate deployment.

Microsoft reference

The Microsoft HTTP Redirect reference describes destination handling and response-status configuration. Use those options in the context of your binding and proxy topology, not as a generic command pasted onto every IIS site.


Was this answer helpful?

« Back
Contact

Write to us

Do you have questions about our services or need a quote? Write to us and we will respond as soon as possible.

Contact form

Fields marked * are required.