Azureはじめました

Windows Azureで業務システムを組んでみる日記

BootstrapのGlyphIconを使うとwoffファイルで404がモリモリ出る話

In my case I was getting a 404 for glyphicons-halflings-regular.woff, and non visible glyphicons on mobile browsers.

I finally fixed it adding the MIME type on IIS:

.woff application/x-woff

Edit: Looks like there is some confusion about the MIME type for woff, more than one MIME type being accepted by different browsers, but the W3C says:

application/font-woff

Bootstrap 3 Glyphicons not working

woffはmime-typeで登録されてないのでIISが弾いてた。

解決法

web.configでmime-typeを指定しておけばいいらしい。

  <system.webServer>
    <staticContent>
      <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
      <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
    </staticContent>
  </system.webServer>

svgもデフォルトでは未登録らしいので一緒に登録しとくといい。