[英]Google Font: no Access-Control-Allow-Origin:*
WordPress网站出现问题:*请参阅下文
你好。 在隐身的Chrome浏览器和Firefox上,未显示Google字体。
我在控制台中得到的错误是:
Font from origin 'http://fonts.gstatic.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://volusiaflaglerac.com' is therefore not allowed access.
根据这些说明https://developers.google.com/fonts/docs/troubleshooting ,代理将剥离Access-Control-Allow-Origin:*
所以我把这段代码放在我的.htaccess文件中:
Header add Access-Control-Allow-Origin "*" Header add Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT"
这是其中一种Google字体的代码:
<link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:400,700' rel='stylesheet' type='text/css'>
根据我在http://www.rexswain.com/httpview.html上运行的报告,它正在读取访问控制代码。
我仍然看到默认字体。
我想念什么?
编辑:请帮忙!
这是服务器上的安全问题,阻止其自身下载外部文件。
由于.htaccess修改不起作用,因此您应该下载google字体并将其添加到您的网站。
仅供参考,此Chrome扩展程序可以帮助您绕过浏览器上的跨源请求,但对于您的用户来说,错误仍然存在
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.