2012-05-10 54 views
0

我试图以.otf/.woff/.svg格式提供一些网页字体。浏览器不渲染字体,而我看到的控制台以下错误:Apache上的字体MIME类型出错

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 /字体文件的问题。我正在运行Apache 2.2.22。我已经在.htaccess文件和/etc/apache2/mods-available/mime.conf中尝试了许多不同的AddType指令组合,但无论我继续得到那些错误还是字体都不渲染。我已经在Chrome和Firefox中尝试了这一点,并且得到相同的错误并且没有渲染。我错过了什么?

回答

0

如果有人遇到这个问题,答案确实是服务器配置问题,带有AddType指令。文件没有被正确加载,所以配置文件没有被加载。