如果我键入example.com,它将按照我的意愿重定向到https://example.com。但是打字http://example.com/blog当它仍然重定向到https://example.com将HTTP重定向到所有页面的HTTPS
<rewrite>
<rules>
<clear/>
<rule name="Force HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true"/>
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="false" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
我怎样才能使HTTPS添加到任何用户写的吗?
你在这里试过了吗? http://stackoverflow.com/a/47095/993547 –
是的。我已经添加了出站规则,现在仍然是,它重定向到根 – crystyxn
请尝试此http://stackoverflow.com/questions/32523540/http-to-https-rewrite-too-many-redirect-loops-iis-7有关详细信息,请按照此文章http://www.hanselman.com/blog/HowToEnableHTTPStrictTransportSecurityHSTSInIIS7.aspx –