I am using bootstrap glyphicons in my Asp.Net MVC5 web app ,
It is showing all well on local system but after publishing it on server all the glyphicons are either square boxes or either question mark .
After inspecting network element I am getting two errors related to glyphicons-halflings-regular.woff file but I don't know what it mean and how to correct it
Asked
Active
Viewed 578 times
0
-
Check your documentation for accessing static files during production. Conversely, you can use `CDN`s; and do change your request from `http` to `https` – Sreetam Das Jun 13 '17 at 04:26
-
Can you make sure all your .woff files are also deployed ? – ISHIDA Jun 13 '17 at 04:33
-
path is not correct – Asif Raza Jun 13 '17 at 04:47
-
what happens when you try to access the "woff" file from the exact URL you are seeing in GET request in the screenshot? Either the issue is with the path or there is an access related issue. When the application runs in IIS, or in production server, it runs within the context of a different user (mainly, Application pool user, unless specified otherwise). Its worth checking the access rights on the folders as well. – Nirman Jun 13 '17 at 04:54
-
@nirman , ttf file is showing fonts but woff file is not showing preview , Please check my updated question , ttf and woff they both are in same folder . If ttf is accessible in that folder than how come woff has access related issue – Jun 13 '17 at 05:04
-
Possible duplicate of [Proper MIME type for .woff2 fonts](https://stackoverflow.com/questions/28235550/proper-mime-type-for-woff2-fonts) – Tien Nguyen Ngoc Jun 13 '17 at 06:18
1 Answers
0
Add
<system.webServer>
<staticContent>
<remove fileExtension=".woff"/>
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff"/>
<remove fileExtension=".woff2"/>
<mimeMap fileExtension=".woff2" mimeType="application/x-font-woff2"/>
</staticContent>
</system.webServer>
For WOFF 2.0
<system.webServer>
<staticContent>
<remove fileExtension=".woff"/>
<mimeMap fileExtension=".woff" mimeType="font/woff"/>
<remove fileExtension=".woff2"/>
<mimeMap fileExtension=".woff2" mimeType="font/woff2"/>
</staticContent>
</system.webServer>
in your web.config
file.

Ashiquzzaman
- 5,129
- 3
- 27
- 38