0
votes

I am trying to setup https redirects to same site having different bindings. i.e Site1 = www.domain1.com Site2 = www.domain2.com Site3 = www.domain3.com

I am using the following redirect rules but they only work for first site and not working for other 2 sites

    <rewrite>
    <rules>

    <rule name="HTTP/S to HTTPS Redirect" enabled="true" stopProcessing="true">
    <match url="http://domain1.com" />
    <conditions>
        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
    </conditions>
    <action type="Redirect" url="https://domain1.com" redirectType="Permanent" />
    </rule> 

    <rule name="HTTP Redirect to HTTPS 2" enabled="true" stopProcessing="true">
    <match url="http://domain2.com" />
    <conditions>
        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
    </conditions>
    <action type="Redirect" url="https://domain2.com" redirectType="Permanent" />
    </rule>

Please guide what I am missing here. As http://domain1.com redirects to https://domain1.com but domain2 is not working.

1

1 Answers

0
votes

I separate my URL rewrites into the web.config for each of the applications within a site, and each site in IIS. Are your rewrite rules at the server root level of IIS?