Win2012(或2016)服务器IIS8(或IIS10)实现http自动跳转https

版权声明:ssl盾 www.ssldun.com 原创作品 https://blog.csdn.net/weixin_42127191/article/details/88415996

配置如下:
想要效果是,输入域名http://ssldun.com自动变成https://www.ssldun.com

1、安装ssl证书。

Server2016-1-1.png2、导入相关证书

Server2016-1-2.png3、进入相关网站,绑定HTTPS主机头到网站。

Server2016-1-3.png

4、安装URL重写工具。

Server2016-1-4.png

5、在想要跳转的网站上,双击“url 重写”

Server2016-1-5.png

6、添加空白规则

Server2016-1-6.png

7、添加url规则
名称:http to https
模式:(.*)
展开条件

Server2016-7.png

8、继续添加URL规则
添加条件
条件输入:{HTTPS}
模式:^OFF$

Server2016-8.png9、继续添加URL规则
操作类型:重定向
重定向URL:https://{HTTP_HOST}/{R:1}
重定向类型:已找到(302) 或 参阅其它(303)

Server2016-9.png

10、最后一步,应用

Server2016-10.png

以上方式比较繁琐,也可以参考如下简单方式进行配置

https://www.ssldun.com/html/prproblem/show-82.html

猜你喜欢

转载自blog.csdn.net/weixin_42127191/article/details/88415996