css - 未在 https 中加载的 font-awesome 会在 Web 浏览器控制台中出现错误,但不会在 http 中出现错误?怎么修
问题描述
当我将我的网站 URL HTTP 更改为 https 时,我们将源代码 HTTP 更改为 https 仍然在 chrome 控制台中遇到混合内容错误。这一行写在控制台中:-Mixed Content: The page
https://example.com/
was loaded over HTTPS but requested an insecure font http://www.example.com/resource/home/new_resources/fonts/font-awesome/fontawesome-webfont.woff2?v=4.7.0
。此请求已被阻止;内容必须通过 HTTPS 提供。我的网站使用 Codeigniter 框架、Apache 2.3、mysql
解决方案
将此代码添加到您的.htaccess
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
base_url
然后像这样改变你https://www.yoursite.com
推荐阅读
- c# - 带有 MVC 区域的 EF 迁移
- java - 尝试在 android 项目中集成 Google Nearby Message API
- wordpress - 为 wordpress 中新生成的自定义帖子类型分配唯一的代码 ID
- javascript - Angular 自定义焦点指令不适用于 ion-item(但适用于本机)
- angular - 角度编译 .less 将像素计算为百分比:'calc(100% - 26px)' to 'calc(76%)
- python - opencv中的三角形填充
- java - java RETURN_GENERATED_KEYS 会影响性能吗?
- spring - Spring Cloud Stream 消息处理
- android - 如何从 Android 分页组件中的 PagedListAdapter 中删除项目
- regex - 使用 Golang 正则表达式查找一个整数后跟一个字符串