引入Bootstrap老是报错:the server responded with a status of 404 (Not Found)

    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映射

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值