在Web.config中
新增代码
<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>内,<handlers>下边
标签:Web,新增,https,强制,config,下边 From: https://www.cnblogs.com/wzzcc/p/17777134.html