解决办法 fonts/fontawesome-webfont.woff2 404 (Not Found)
来源:互联网 发布:optisystem mac air 编辑:程序博客网 时间:2024/06/05 07:47
问题:
虽然网页正常显示和运行,但是有2个字体文件出现404错误。像笔者这种强迫症是接受不了的。
解决:
因为笔者的服务器是虚拟主机,只需要在主机控制器平台添加对应的MIME类型即可。
这样服务器就支持这两种字体文件,不会报错了。
第一次使用FontAwesome加载字体,但是使用的时候却提示fonts/fontawesome-webfont.woff2 404 (Not Found),很明显这是由于文件不存在导致的问题。然后我们具体来看一下:
可能存在两种情况:
1、项目发布过程中这个文件没有被拷贝到发布目录,我这次碰到的问题就是这个原因导致的,在项目grunt build时会进行文件的copy操作,其中对文件后缀做了限制,所以我只需要加上这个.woff2即可;
2、由于web服务器不支持导致的:
nginx不支持的情况,可以参考下面的配置解决:
location ~* \.(eot|otf|ttf|woff|woff2|svg)$ {add_header Access-Control-Allow-Origin *;} AddType application/x-font-woff woffAddType application/x-font-woff2 woff2
Apache默认是不支持.woff和.woff2的,所以要设置一下:
location ~* \.(eot|otf|ttf|woff|woff2|svg)$ {add_header Access-Control-Allow-Origin *;} AddType application/x-font-woff woffAddType application/x-font-woff2 woff2
IIS默认也是不支持的,可以添加MIME类型来解决:
.woff2 application/x-font-woff
阅读全文
0 0
- 解决办法 fonts/fontawesome-webfont.woff2 404 (Not Found)
- 出现fonts/fontawesome-webfont.woff2 404 (Not Found)
- 【问题&解决】fonts/fontawesome-webfont.woff2 404 (Not Found)
- fonts/fontawesome-webfont.woff2 404
- webfont.woff2和webfont.woff下载超时报404错误
- fontawesome-webfont to android
- Bootstrap glyphicons-halflings-regular.woff2 Not found
- VS2013下fontawesome-webfont.woff路径下有还报404错配置web.config方法
- Android fontawesome-webfont.ttf字体库的使用
- Eclipse validation error with fontawesome-webfont.svg
- Eclipse validation error with fontawesome-webfont.svg
- 解决用Asp.net Mvc 开发时出现glyphicons-halflings-regular.woff2 not found的问题
- 解决用Asp.net Mvc 开发时出现glyphicons-halflings-regular.woff2 not found的问题
- How to remove error about glyphicons-halflings-regular.woff2 not found
- Sqlite3 not found解决办法
- declare:not found解决办法
- configure: error: FreeType development files not found. Fonts will not be built
- Webfont
- 1040: [ZJOI2008]骑士
- gradle打包:Keystore file xxx not found for signing config
- iOS支付宝回调状态码
- Java8创建 stream的几种方式
- java读取mongoDB某个数据库的集合的指定字段值,并存入mysql数据库指定表中
- 解决办法 fonts/fontawesome-webfont.woff2 404 (Not Found)
- ixgbe 驱动安装
- 从短信url链接跳转到APP
- MySQL性能优化方案总结
- fabric源码解析7——peer的ChaincodeSupport服务
- 多线程ManualResetEvent和AutoResetEvent
- 多线程——线程间通信{wait(); notifyAll();}
- A tool returned an error code from "Performing Post-Build Event"
- a++ 和 ++a 的区别