Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while trying to use fontawesome-webfont.woff in Font Awesome

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?

like image 598
Naveen Avatar asked Oct 03 '22 23:10

Naveen


1 Answers

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

like image 58
dblk1965 Avatar answered Oct 12 '22 12:10

dblk1965