Home  >  Article  >  Web Front-end  >  解决Web部署 svg/woff/woff2字体 404错误_html/css_WEB-ITnose

解决Web部署 svg/woff/woff2字体 404错误_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:50:57731browse

问题:最近在IIS上部署web项目的时候,发现浏览器总是报找不到woff、woff2字体的错误。导致浏览器加载字体报404错误,白白消耗了100-200毫秒的加载时间。

原因:因为服务器IIS不认SVG,WOFF/WOFF2 这几个文件类型,只要在IIS上添加MIME 类型即可。

解决方法

1、打开服务器IIS管理器,找到MIME类型。

2、添加MIME类型 添加三条:  

       文件扩展名      MIME类型 

.svg             image/svg+xml
.woff            application/x-font-woff
.woff2          application/x-font-woff

注:本文在win8环境下IIS7版本中填写的MIME类型,在IIS6、IIS7 MIME类型管理所处位置不一样,但是添加方式和参数均相同。

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn