<rule name="UreRedirect" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="^OFF$" />
<add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" />
</conditions>
<action type="Redirect" url="https://example.com/{R:1}" redirectType="SeeOther" />
我使用上面的web.config代码
我已经使用IIS添加了所有可能的绑定
SSL已针对example.com进行配置,但未针对www.example.com
进行配置我试过这些链接,但这些无关紧要
iis url redirect http to non www https
How to redirect http to https and www to non-www via web.config?
答案 0 :(得分:0)
您可以使用:
<rewrite>
<rules>
<rule name="redirect" enabled="true">
<match url="(.*)" />
<action type="Redirect" url="https://piposx.com/{R:0}" appendQueryString="true" redirectType="Permanent" />
</rule>
</rules>
</rewrite>