0
我有这样的重写规则:IIS URL从非www重定向到www不工作
<rewrite>
<rules>
<rule name="Force non-WWW and SSL" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" />
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://www.yourdomainname.com/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
它成功地重定向example.com到https://example.com,但是,我需要重定向https://www.example.com,我怎样才能做到这一点?
是的,我也想动态域名了。您的规则是否可以使用https重定向? –
你还希望如果没有www追加? –
我已经改变规则请尝试 –