Secret ingredients to quality software


Do you use URL Rewrite to redirect HTTP to HTTPS?

Created on 16 Aug 2016 | Last updated by Stanley Sidik on 16 Aug 2016 09:30 AM (over 4 years ago)

Using IIS URL Rewrite Module, Web administrators can easily set up rules to define URL rewriting behavior based on HTTP headers, HTTP response or request headers, IIS server variables, and programmatic rules. HTTP to HTTPS redirect helps boost your Google site ranking as well as adding enforcing SSL security.

First you must download the IIS URL Rewrite module from Web Platform Component Installer. Ensure that a valid SSL Certificate is installed in IIS Server.

  1. Open URL Rewrite and begin with Add Rule(s) | Blank rule (Inbound rules)
  2. Name the rule "HTTP to HTTPS redirect"
  3. Add Pattern (.*)
  4. Add Conditions
  • Condition input: {HTTPS}

    - Pattern: off

  1. Add Action
  • Redirect type: Found (302)
  1. Apply | Back to Rules
Designing border protection.
Figure: HTTP to HTTPS redirect using IIS URL Rewrite module
Stanley SidikStanley Sidik

We open source. This page is on GitHub