Redirect HTTP to Force HTTPS

Redirecting HTTP to HTTPS isn't just about encryption - it's also a requirement for many compliance and audit-ready initiatives. This guide shows you how to force HTTPS in IIS using a simple web.config rule, keeping your intranet traffic fully secure and meeting best practices.

IIS / web.config

After setting up your self-signed, standard, or wildcard SSL certificate, you can use IIS URL Rewrite rules to automatically force HTTPS for all requests.

Step-by-Step:

  1. Make sure the URL Rewrite Module is installed on your IIS server.
  2. Open or edit your site's web.config file in Notepad or similar.
  3. Inside the <system.webServer> section, add the following rule:
<rewrite>
  <rules>
    <rule name="Force HTTPS" enabled="true" stopProcessing="true">
      <match url="(.*)" />
      <conditions>
        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
      </conditions>
      <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
    </rule>
  </rules>
</rewrite>

Once saved, all HTTP requests will automatically redirect to HTTPS.

Still deciding which certificate type is best? See our SSL for Intranets overview to compare self-signed, standard, and wildcard certificates.

Troubleshooting Common Issues

  • Check that your SSL certificate is valid and installed correctly before forcing HTTPS.
  • Make sure you don't have conflicting rewrite rules that create redirect loops.
  • If you run multiple bindings or host headers, ensure the host name matches the SSL certificate's common name.

Common Questions

Why should I force HTTPS on my intranet?
Forcing HTTPS ensures all intranet traffic is encrypted, preventing login credentials and data from being sent in plain text. It's also required for compliance and audit readiness.
Will this work if I'm using a self-signed certificate?
Yes. Once the certificate is installed and bound to IIS, forcing HTTPS will secure all requests. Users may still see browser warnings if the certificate isn't trusted.
How do I fix a redirect loop after forcing HTTPS?
Make sure the rule only applies when HTTPS is off. The sample web.config rule includes a condition {HTTPS}=off to prevent loops.
Do I need to restart IIS after making changes?
Not always. Saving the updated web.config usually refreshes automatically, but you can run iisreset if you don't see the redirect working.

Related Pages

 
 
Popular Pages
 
SharePoint AlternativeForm BuilderBank IntranetsCredit Union IntranetsBank Help DeskDocument RepositoryU.S. Based Banking IntranetData-Secure Intranet for Banks & Credit Unions
 
✦ trusted in banking since 2004 ✦