Windows Server 2008 IIS7 HTTP重定向HTTPS
1.下载URL重写模块:
2.打开IIS信息服务管理器,选中站点找到SSL设置取消【要求SSL】
3.复制下面代码到站点的web.config文件的configuration节点中
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Found" />
</rule>
</rules>
</rewrite>
</system.webServer>