How to redirect Website from HTTP to HTTPS in windows hosting?

WebSupporters Windows servers support IIS URL Rewrite module. If you have an SSL certificate on your website, you can use this module to automatically redirect your website visitors from HTTP to HTTPS.

How to redirect the Website from HTTP to HTTPS in windows hosting with IIS?

  1. Be sure that the SSL Certificate is properly installed on your domain, and the website is resolving on your domain like
  2. 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="{R:1}" redirectType="Permanent" />
  3. needs to be replaced by the Domain Name for which the SSL Certificate is issued.

Was this article helpful?

Related Articles