网站升级 HTTPS ,全 html 文件, web 服务器 IIS。 有什么好办法?
資深大佬 : itll 20
- 网站升级 HTTPS,全 html 文件,页面内引用图片,js 都是写的完整地址如下:
<script type="text/javascript" src="http://www.demo.com/js/xx.js"></script> .logo a{display: block;float: left;background: url( http://www.demo.com/images/logo.png) no-repeat 0 0px;height: 50px;width: 170px;} <img src="http://www.demo.com/images/logo.jpg"></a>
- IIS 已经配置 301 重定向(),但页面中图片链接写完整地址 http,导致 chrome 显示不安全
- 参考: https://www.hangge.com/blog/cache/detail_1885.html
- 目前找到 2 种解决方法,都需要修改许多页面(预估 500 个左右)
- 修改页面中链接地址
<img src="https://example.com/ququ.jpg" /> => <img src="//example.com/static//ququ.jpg" />- 页面中添加
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> //站点内的 HTTP 请求,都会 HTTPS 的方式发起- 参考: https://imququ.com/post/sth-about-switch-to-https-3.html
大家还有简单的方法吗?
大佬有話說 (22)