0

我正在尝试以 .otf/.woff/.svg 格式提供一些网络字体。浏览器未呈现字体,我在控制台中看到以下错误:

Resource interpreted as Font but transferred with MIME type text/html: "http://localhost/file.woff".
Resource interpreted as Font but transferred with MIME type text/html: "http://localhost/file.otf".
Resource interpreted as Font but transferred with MIME type text/html: "http://localhost/file.svg".

同一组文件在另一台 Web 服务器上运行良好,但在我的本地开发环境中却不行,所以我知道 HTML/CSS/Font 文件没有问题。我正在运行 Apache 2.2.22。我已经在 .htaccess 文件和 /etc/apache2/mods-available/mime.conf 中尝试了许多不同的 AddType 指令组合,但无论如何我都会继续收到这些错误并且字体不会呈现。我在 Chrome 和 Firefox 中都试过这个,并且得到相同的错误并且没有渲染。我错过了什么?

4

1 回答 1

0

如果有人遇到这个问题,答案确实是服务器配置问题,使用 AddType 指令。文件未正确加载,因此未加载配置。

于 2012-05-17T14:06:53.630 回答