托管网站字体 - 令人敬畏的跨源请求被阻止

Mr *_*ide 3 css .htaccess font-awesome

我已从源站点下载FontAwesome zip.并在我的网站中包含font-awesome.css文件.

Ealier图标显示完美,现在图标不会出现,显示以下错误.我可以知道问题的原因.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://www.traderstree.com/application/views/scripts/templates/clothing-3/includes/font-awesome/fonts/fontawesome-webfont.woff?v=4.7.0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
Run Code Online (Sandbox Code Playgroud)

我的网站:traderstree.com

Pol*_*ris 11

在.htaccess中试试这个:

<FilesMatch "\.(ttf|otf|eot|woff)$">
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
  </IfModule>
</FilesMatch>
Run Code Online (Sandbox Code Playgroud)

并确保使用"sudo a2enmod headers"启用它并重新启动Apache.