Windows Server2016服务器IIS10实现http自动跳转https
环境:windows server 2016 IIS 10
需求:访问HTTP 跳转到HTTPS
证书:如果已经有证书安装即可,如果没有证书可到本站进行选择购买
配置如下:
想要效果是,输入域名http://lizi.tw自动变成https://lizi.tw
步骤如下:
1、安装ssl证书。
![图片[1]-图文详解Windows Server2016服务器IIS10实现http自动跳转https-栗子博客](https://www.lizi.tw/wp-content/uploads/2020/01/Server2016-1-1.png)
2、导入相关证书
![图片[2]-图文详解Windows Server2016服务器IIS10实现http自动跳转https-栗子博客](https://www.lizi.tw/wp-content/uploads/2020/01/Server2016-1-2.png)
3、进入相关网站,绑定HTTPS主机头到网站。
![图片[3]-图文详解Windows Server2016服务器IIS10实现http自动跳转https-栗子博客](https://www.lizi.tw/wp-content/uploads/2020/01/Server2016-1-3.png)
4、安装URL重写工具。
![图片[4]-图文详解Windows Server2016服务器IIS10实现http自动跳转https-栗子博客](https://www.lizi.tw/wp-content/uploads/2020/01/Server2016-1-4.png)
5、在想要跳转的网站上,双击“url 重写”
![图片[5]-图文详解Windows Server2016服务器IIS10实现http自动跳转https-栗子博客](https://www.lizi.tw/wp-content/uploads/2020/01/Server2016-1-5.png)
6、添加空白规则
![图片[6]-图文详解Windows Server2016服务器IIS10实现http自动跳转https-栗子博客](https://www.lizi.tw/wp-content/uploads/2020/01/Server2016-1-6.png)
7、添加url规则
名称:http to https
模式:(.*)
展开条件
![图片[7]-图文详解Windows Server2016服务器IIS10实现http自动跳转https-栗子博客](https://www.lizi.tw/wp-content/uploads/2020/01/Server2016-7.png)
8、继续添加URL规则
添加条件
条件输入:{HTTPS}
模式:^OFF$
![图片[8]-图文详解Windows Server2016服务器IIS10实现http自动跳转https-栗子博客](https://www.lizi.tw/wp-content/uploads/2020/01/Server2016-8.png)
9、继续添加URL规则
操作类型:重定向
重定向URL:https://{HTTP_HOST}/{R:1}
重定向类型:已找到(302) 或 参阅其它(303)
![图片[9]-图文详解Windows Server2016服务器IIS10实现http自动跳转https-栗子博客](https://www.lizi.tw/wp-content/uploads/2020/01/Server2016-9.png)
10、最后一步,应用
![图片[10]-图文详解Windows Server2016服务器IIS10实现http自动跳转https-栗子博客](https://www.lizi.tw/wp-content/uploads/2020/01/Server2016-10.png)
大功告成,不需重启iis服务
原文链接: https://www.lizi.tw/web/6670.html

浙公网安备 33010602011771号