Failed to load resource: the server responded with a status of 404 (Not Found) 错误指向 ../fonts/glyphicons-halflings-regular.woff2
VS2013使用Bootstrap,引入本地Bootstrap文件老是报错!
可能的原因有二:
1.
看是引用的<link href="~/Scripts/bootstrap/css/bootstrap.css" rel="stylesheet" />还是<link href="~/Scripts/bootstrap/css/bootstrap.min.css" rel="stylesheet" />。
路径有问题,具体是在引入字体文件那一块;文件缺失,拷入相应的路径即可。
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'),
url('../fonts/glyphicons-halflings-regular.woff') format('woff'),
url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),
url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
2.请参考:https://stackoverflow.com/questions/32300578/how-to-remove-error-about-glyphicons-halflings-regular-woff2-not-found
解决一: 在web.config文件中配置文件加入
<system.webServer>
......
<staticContent>
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
</staticContent>
</system.webServer>
亲测可以。
解决二:修改IIS映射