web.dev-从原点访问字体已被CORS策略阻止:no访问权利:访问权限控制。标题存在于请求的资源上
我没有在网站上遇到此错误,而是在网上测试时。
这里有人说此代码将修复它:
<IfModule mod_headers.c>
<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
我将上面的代码放在.htaccess中,但Google仍然给出了错误
i get this errors not on my website but when i test it on web.dev in section "Best Practices" ... how can i fix that ?
Some here says this code will fix it :
<IfModule mod_headers.c>
<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css)quot;>
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
I put the code above in my .htaccess but google still gives that error
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
基于 Shaitana&amp; Stephen Ostermiller 的答案您可以将此规则添加到您的
.htaccess
或更好的情况下,如果您指定了域值
Based on shaitana & Stephen Ostermiller's answer you could add this rule to your
.htaccess
Or better if you specified the domain value