Currently we are trying to setup a redirect from htttp to https in our web.config limited to the domains we use. But it's not working.

```
<rewrite>
        <rules>
            <rule name="HTTP to HTTPS redirect" stopProcessing="true">
                <match url="^(?:http(?:s)?:\/\/)?(?:[^\\.]+\.)?mysite\.com(\/.*)?$" />
                <conditions>
                    <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                </conditions>
                <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
            </rule>
        </rules>
    </rewrite>

```

This rule works fine in a regex editor. But not on the webserver. <http://rubular.com/r/3NQTozcigZ>

```
^(?:http(?:s)?:\/\/)?(?:[^\\.]+\.)?mysite\.com(\/.*)?$

```

Looking at the failedreqlogfiles pattern\_match is false. Any insights?

After doing some more testing I'm finding that this works.

```
http://sub.site.com/

```

But this will not work.

```
http://sub.site.com/Account/Logon

```