我刚从一位同事那里了解到,在链接中省略URL的"http | https"部分会使该URL使用它所使用的页面所使用的任何方案.
例如,如果我的页面在http://www.example.com上访问,并且我有一个链接(注意前面的'//'):
<a href="//www.google.com">Google</a>
Run Code Online (Sandbox Code Playgroud)
该链接将转至http://www.google.com.
但是,如果我使用相同的链接访问https://www.example.com上的网页,则会转到https://www.google.com
我想在网上查找有关这方面的更多信息,但我很难想出一个好的搜索短语.如果我搜索"没有HTTP的URL",返回的页面是关于这种形式的网址:"www.example.com",这不是我正在寻找的.
你会称那个无方案的URL吗?无协议的URL?
这适用于所有浏览器吗?我在FF和IE 8中进行了测试,它在两者中均有效.这是标准的一部分,还是我应该测试更多的浏览器?
我在Multisite环境中有3个站点.我也为管理部分启用了SSL.但是我在管理员身上只有一个网站上出现了很多" 混合内容 "错误.结果,管理员中的许多脚本和样式表都被破坏了.
如果我的htaccess规则或wp_config文件出现问题,那么其他网站也应该存在同样的问题.但其他2个站点正常工作.
我在所有三个站点上都安装了几乎相同的插件.我尝试停用插件.也尝试使用基本的Wordpress 2015主题徒劳无功.所以我已经将 插件和主题排除在外.
任何人都可以建议为什么会发生这种情况?
Blocked loading mixed display content "http://sitename/wp-includes/js/thickbox/loadingAnimation.gif"
Blocked loading mixed active content "http://sitename/wp-content/plugins/capsman/framework/styles/admin.css?ver=0.8"
Blocked loading mixed active content "http://sitename/wp-content/plugins/capsman/admin.css?ver=1.3.2"
Blocked loading mixed active content "http://sitename/wp-content/plugins/capsman/framework/styles/admin.css?ver=0.8"
Blocked loading mixed active content "http://sitename/wp-content/plugins/capsman/admin.css?ver=1.3.2"
Blocked loading mixed display content "http://sitename/wp-content/themes/pagelines/sections/boxes/icon.png"
Blocked loading mixed display content "http://sitename/wp-content/themes/pagelines/sections/features/icon.png"
Blocked loading mixed display content "http://sitename/wp-content/themes/pagelines/sections/banners/icon.png"
Blocked loading mixed active content "http://sitename/wp-content/plugins/edit-flow/modules/custom-status/lib/custom-status.css?ver=0.8"
Blocked loading mixed active content …Run Code Online (Sandbox Code Playgroud)我搜索了论坛,但我无法弄清楚如何修复我网站上的混合内容错误以使其成为https.
以下是chrome的错误:
混合内容:页面https://www.example.com/是通过HTTPS加载的,但请求了一个不安全的样式表http://fonts.googleapis.com/css?family=Oswald:300,400,700.此请求已被阻止; 内容必须通过HTTPS提供.
我是一个完整的菜鸟,不知道在哪里/什么改变.
请提供noob指示,提前谢谢,决议将允许我发布....非常感谢!
- -更新 - -
它不起作用(可能是因为我).这是在functions.php文件的代码中的位置,但它不起作用(我在https ssl函数上将http更改为https)
$open_sans = _x( 'on', 'Open Sans font: on or off', 'Divi' );
if ( 'off' !== $open_sans ) {
$font_families = array();
if ( 'off' !== $open_sans )
$font_families[] = 'Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800';
$protocol = is_ssl() ? 'https' : 'http';
$query_args = array(
'family' => implode( '%7C', $font_families ),
'subset' => 'latin,latin-ext',
);
$fonts_url = add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" );
}
return $fonts_url;
}
endif;
Run Code Online (Sandbox Code Playgroud)