註意首先要安裝url重定向模塊 https://www.microsoft.com/zh-CN/download/details.aspx?id=7435 然後在web.config末尾添加如下代碼 <system.webServer> <rewrite> <rules> <rule name="H ...
註意首先要安裝url重定向模塊 https://www.microsoft.com/zh-CN/download/details.aspx?id=7435 然後在web.config末尾添加如下代碼 <system.webServer> <rewrite> <rules> <rule name="HTTP to HTTPS redirect" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="off" ignoreCase="true" /> </conditions> <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" /> </rule> </rules> </rewrite> </system.webServer>