html - 字体图标不显示

标签 html apache .htaccess css magento

您好,我正在使用 Magento 版本 1.9.0.1 我一直在绞尽脑汁,但我无法让它工作。我的主域的任何子域都没有呈现主题附带的字体图标,但是主域显示了这些图标。另一方面,Safari 正在从我的子域呈现我的字体图标,但 Chrome 和 FireFox 不是。这是 Chrome Dev Console 输出的内容

Font from origin 'http://brandster.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://breezesta.brandster.com' is therefore not allowed access.

我确实将它添加到子域的 .htaccess 文件中

<FilesMatch "\.(ttf|otf|eot|woff|font.css)$"> <IfModule mod_headers.c> Header set Access-Control-Allow-Origin "*" </IfModule> </FilesMatch>

还是不行。任何人都可以阐明这个问题。提前致谢。

最佳答案

似乎您的 htaccess 正在阻止使用来自其他域(包括子域)的文件。也许试试看这是否有效?

<FilesMatch "\.(ttf|otf|eot|woff|font.css)$">
 <IfModule mod_headers.c>
  Header set Access-Control-Allow-Origin "*.brandster.com"
 </IfModule>
</FilesMatch>

如果这对你有用。

关于html - 字体图标不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26537801/

相关文章:

html - CSS 多字体系列?

jquery - HTML 无法从服务器加载 jquery.js

html - Google主页使用了什么技术(吉他弦)

.htaccess - 多个域的站点地图文件名的 Htaccess 规则

html - 水平导航栏中的文本(使用 ul 和 li)未垂直居中

java - SSL - HTTPException : HTTP response '413: Request Entity Too Large' when communicating

php - 通过 .htaccess 更改根文件夹

Apache 不提供静态文件 + Ubuntu

php - 向域名添加尾部斜杠

.htaccess - .htaccess 中 PDF 和图像文件的规范标题链接