当前位置:首页 >> 帮助中心
关于我们
   关于我们
   联系我们
   最新公告
   公司动态
   支付方式
   帮助中心
   帮助中心
IIS7/IIS8/的HTTP到HTTPS的重定向
来自:网站管理员  发布时间:2017/3/18 23:30:34

一、配置web.config文件

1.找到网站根目录web.config文件,替换一下内容(如果没有此文件可以创建一个);

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

<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>

</configuration>

2.重启IIS测试访问。

返回上一页