0

I need to do a URL redirect for a single page. If the client visits https://example.com/default.aspx I need to send to http://example.com/default.aspx and having little success so far. Can anyone shed some light on the best way to limit restrict which page is directed?

Currently what I have is working, but causes a re-direct loop for the pages I do want to be https.

<rule name="ForceNonHttps" stopProcessing="true">
    <match url="(.*)default/(.*)" ignoreCase="true" negate="true" />
    <conditions>
      <add input="{SERVER_PORT}" pattern="^443$" />
    </conditions>
   <action type="Redirect" redirectType="Found" url="http://{HTTP_HOST}{REQUEST_URI}" />
</rule>
4

1 回答 1

1

The rewrite rule below worked great for me!

<rule name="default.aspx HTTPS to HTTP" stopProcessing="true">
    <match url=".*" />
        <conditions logicalGrouping="MatchAny">
        <add input="{URL}" pattern="https://example.com/default.aspx$" />
    </conditions>
    <action type="Redirect" appendQueryString="false" url="http://example.com/default.aspx" redirectType="Permanent" />
</rule>
于 2014-10-23T13:55:45.573 回答