HTTP to HTTPS Redirection - IIS

KB Tags associated with this article:
Use any one tag

<%SFNB_RESE123LLER_BRA123ND_NAME%> Windows servers support IIS URL Rewrite module. You can make use of this module to automatically redirect your visitors from HTTP to HTTPS.

Setting the HTTPS Redirection

Step 1: Verify Digital Certificate Installation.

Ensure that the Digital Certificate is properly installed on your Hosting Order, and the site is resolving on


Your site will work on or or, depending on the Common Name for which you had the certificate issued. Resolving HTTPS on anything other than this Common Name would result in a certificate name mismatch error.

Step 2: Add Redirection.

Create a web.config file under the site's directory and add the following lines to it. In case there already exists a web.config in your site's directory, carefully edit it to add these lines

<xml version="1.0"?>

        <rule name="Redirect to HTTPS" stopProcessing="true">
         <match url="(.*)" />
          <add input="{HTTPS}" pattern="^OFF$" />
         <action type="Redirect" url="https://<common_name>/{R:1}" redirectType="Permanent" />


<common_name> needs to be replaced by the Common Name for which the Digital Certificate is issued.