我最近在我的网站上添加了SSL,但它一直给我错误:
Mixed Content: The page at 'https://youtubehulp.nl/comingsoon/' was loaded over HTTPS, but requested an insecure stylesheet 'http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,300italic,400,400italic,600,600italic,700,700italic,900,900italic'. This request has been blocked; the content must be served over HTTPS.
指向字体表的链接为https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,300italic,400,400italic,600,600italic,700,700italic,900,900italic
我也尝试下载该文件,然后加载本地版本,但这也没有用。
尝试过的代码:
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,300italic,400,400italic,600,600italic,700,700italic,900,900italic">
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,300italic,400,400italic,600,600italic,700,700italic,900,900italic">
<link rel="stylesheet" type="text/css" href="font.css">
@import url("//fonts.googleapis.com/css?family=Source+Sans+Pro:300,300italic,400,400italic,600,600italic,700,700italic,900,900italic");
@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,300italic,400,400italic,600,600italic,700,700italic,900,900italic");
还要确保字体文件中的所有链接都是HTTPS
我希望有人能帮助我。
答案 0 :(得分:0)
你的样式表https://youtubehulp.nl/comingsoon/css/style.css中有一个简单的拼写错误:
@import url("https//fonts.googleapis.com/css?family=…");
^^
协议名称后缺少:
。因此,它是相对网址,当浏览器使用当前网址创建绝对网址时,结果自然为https://youtubehulp.nl/comingsoon/css/https//fonts.googleapis.com/css?family=Source+Sans+Pro:300,300italic,400,400italic,600,600italic,700,700italic,900,900italic
请求该网址会使您的服务器重定向到http://www.youtubehulp.nl/comingsoon - 并且 是混合内容警告的来源。