Sunday, January 04, 2015

How to force redirect all HTTP requests to HTTPS in IIS through Web.Config setting?

Web.config configuration setting to force redirect all http requests to https with all query string parameters in IIS 7.5 / 8.0 on Windows Servers.

<?xml version="1.0" encoding="UTF-8"?>
                <clear />
                <rule name="Redirect to https" stopProcessing="true">
                    <match url="(.*)" />
                        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                    <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />


  1. The above solution will work well with all hosts including shared hosting servers
  2. Ensure your https URL is functioning properly

No comments:

Post a Comment

Share your comments