5

I am trying to use Font Awesome in my project. I modified the font-awesome.css to point to my directory where the font files are stored. So now it looks like this:

src: url('fontawesome-webfont.eot?v=3.2.1');
src: url('fontawesome-webfont.eot?#iefix&v=3.2.1') format('embedded-opentype'), url('fontawesome-webfont.woff?v=3.2.1') format('woff'), url('fontawesome-webfont.ttf?v=3.2.1') format('truetype'), url('fontawesome-webfont.svg#fontawesomeregular?v=3.2.1') format('svg');

But the problem is that it throws error on my browser console for the statement url('fontawesome-webfont.woff?v=3.2.1'). The error is:

GET http://localhost/***/***/fontawesome-webfont.woff?v=3.2.1 400 (Bad Request)         fontawesome-webfont.woff?v=3.2.1:1
GET http://localhost/***/***/fontawesome-webfont.ttf?v=3.2.1 400 (Bad Request)      fontawesome-webfont.ttf?v=3.2.1:1

If I modify the statement to url('fontawesome-webfont.woff') then it works without any error. I found this question on StackOverflow where user has same problem but no satisfactory answers are provided.

Anyone knows the reason for this? Also why are the additional parameters in font's URL provided for like fontawesome-webfont.eot?#iefix&v=3.2.1 and fontawesome-webfont.svg#fontawesomeregular?v=3.2.1?

Community
  • 1
  • 1
Naveen
  • 6,786
  • 10
  • 37
  • 85

3 Answers3

7

I had nearly the same problem: the only fontawesome-webfont.woff?=3.2.1 gives the error but another woff without version is loading with no problem and ttf with 3.2.1 was loaded with no problem.

I have added MIME type woff as font/woff to the application's MIME types.
Getting 200 now.
Regards

benka
  • 4,732
  • 35
  • 47
  • 58
dblk1965
  • 132
  • 4
  • First src line is to support IE9, but it needs this answers IIS configure fix. Second src line is for IE6-8. See http://webmasters.stackexchange.com/questions/26992/if-i-have-only-woff-and-eot-what-browsers-am-i-supporting-with-font-face and http://www.fontspring.com/blog/fixing-ie9-font-face-problems – RockResolve Dec 12 '13 at 23:03
  • this worked for me, but just wondering...why does this fix it? – Douglas Timms Oct 05 '15 at 01:32
0

Just add the following MIME types :) woff font/woff woff2 font/woff2

-3

The reason of this issues is wrong path of fonts or missing required fonts.To fix the issue follow steps bellow

1: go to http://fontawesome.io/

2: download fonts, and extract downloaded zip file

3: go to fonts folder, copy fonts

4: past fonts to http://localhost/***/***/

hope it will be help full for you.

Khandad Niazi
  • 2,326
  • 3
  • 25
  • 22