Sunday, 4 May 2014

font-awesome.css not found



Scenario:
I faced this problem when I deployed my MVC 4 application to IIS. I had used font-awesome.css which was all fine while development perion but after deployed I always see this firebug error that font-awesome.css not found.

Why this problem?

Actually iis change the url request like something ../fonts/fontawesome-webfont.eot%3F which is not actually valid path so this 404 not found occur.

What to do?

There could be several way I found over google like configure IIS or changing to web.config. I always prefer write and solve rather than configuring wizard. Enough talking,

Just add/merge the following line to web.config and your problem going to be solved!!

<system.webServer>
    <staticContent>
      <remove fileExtension=".woff" /> <!-- In case IIS already has this mime type -->
      <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
    </staticContent>    
  </system.webServer>

feeling confused which web.config as you've two web.config file inside your project; one at the top directory and another inside views sub-directory. Well, when someone don't specify which one then assume it's the top one :)

No comments:

Post a Comment