Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font-Awesome error 404 on fonts

I do not know what is going on but in the browser console I can see 3 errors related to font-awesome

 GET http://www.desktop.just4bettors.mobi/fonts/fontawesome-webfont.woff2?v=4.3.0   GET http://www.desktop.just4bettors.mobi/fonts/fontawesome-webfont.woff?v=4.3.0  GET http://www.desktop.just4bettors.mobi/fonts/fontawesome-webfont.ttf?v=4.3.0  

I know it is ridiculous I can not figure out this by myself, but everything seems to be OK, in my index.html I have something like this

<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.css" /> 

and that's all I have related to the font-awesome thing, I already check the path and I am not wrong with that.

Is this happening with any of you guys ?

enter image description here

UPDATE

this is the NGINX part where I load some content in the headers

add_header Content-Security-Policy "style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://fonts.gstatic.com https://themes.googleusercontent.com https://assets.zendesk.com; font-src 'self' https://themes.googleusercontent.com https://fonts.gstatic.com;"; 
like image 863
Non Avatar asked Mar 28 '15 00:03

Non


People also ask

Why do font awesome icons not work?

Make sure you're using the latest and greatest by updating your CDN code reference, updating your Font Awesome package via npm, or downloading a fresh copy of Font Awesome. You can check with version an icon was added to on its detail page (e.g. question-circle was added in Verion 1 but last updated in 5.0. 0).

Why is font awesome not working in HTML?

Make sure that the Font Awesome CSS file is loaded and that the "webfonts" folder is not missing in the website project. To check whether the CSS file is loaded well, open your page source code on a web browser by right-clicking on the page and selecting "View page source" or by pressing Ctrl+U while on the page.


1 Answers

Better yet, add this section to your web.config and then those mime types will be automatically added to IIS on any server you deploy to. (The remove is to avoid a duplicate mime type error in case they are already there)

  <system.webServer>     <staticContent>       <remove fileExtension=".woff" />       <mimeMap fileExtension=".woff" mimeType="application/font-woff" />       <remove fileExtension=".woff2" />       <mimeMap fileExtension=".woff2" mimeType="font/x-woff" />     </staticContent>     </system.webServer> 
like image 91
jhoelz Avatar answered Sep 28 '22 05:09

jhoelz