IIS7需要先确认是否安装 “URL REWRITE2 ” 伪静态模块 , 如果您已经安装可以跳过
下载地址 : http://www.iis.net/downloads/microsoft/url-rewrite
URL 重写,如果安装的是英文版的 应该是【Url rewrite】
名称 : HTTPS
匹配URL 模式: (.*)
添加条件: 条件: {HTTPS} 模式: off
操作类型选择:重定向
重定向URL:https://{HTTP_HOST}/{R:1}
然后保存即可
直接把伪静态添加到web.config
<?@xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rulename="HTTP to HTTPS redirect"stopProcessing="true">
<matchurl="(.*)"/>
<conditions>
<addinput="{HTTPS}"pattern="off"ignoreCase="true"/>
</conditions>
<actiontype="Redirect"redirectType="Found"url="https://{HTTP_HOST}/{R:1}"/>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Copyright © 2013-2023 xikunyun.com. All Rights Reserved 西昆云版权所有 南通西昆云计算有限公司 苏ICP备20014144号-2