且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

由 IIS 提供服务时,Fontawesome 不起作用

更新时间:2023-12-02 18:37:10

用于 MVC3 的 SquishIt 捆绑工具是对字体路径进行 url 编码,所以 ../fonts/fontawesome-webfont.eot? 在css 文件已更改为 ../fonts/fontawesome-webfont.eot%3F.这通常返回 400,因为 %3F 被认为是不安全的.如果设置 requestPathInvalidCharacters="" 则 %3F 被认为是安全的,但显然没有文件 ``../fonts/fontawesome-webfont.eot%3F`,因此是 404.

SquishIt bundling tool for MVC3 was url-encoding the font paths, so ../fonts/fontawesome-webfont.eot? in css file was changed to ../fonts/fontawesome-webfont.eot%3F. This normally returns 400, because %3F is considered unsafe. If you set requestPathInvalidCharacters="" then %3F is considered safe, but there is obviously no file ``../fonts/fontawesome-webfont.eot%3F`, therefore 404.

我从包中删除了 fontawesome.css,一切正常.

I removed fontawesome.css from the bundle and everything works fine.