網站整站301跳轉到https的方法:
在網站根目錄修改web.config的配置文件,例如:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="301" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^abc\.cn$" />
</conditions>
<action type="Redirect" url="https://www.abc.cn/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>