@font-face showing 404 error for fonts i imported .woff and .ttf @font-face showing 404 error for fonts i imported .woff and .ttf apache apache

@font-face showing 404 error for fonts i imported .woff and .ttf


Is your website running on a windows server? If so try to add the correct Mime types for the font extensions. This might be a duplicate of: Why is @font-face throwing a 404 error on woff files?

Btw, you have a typo in the last sentence of the "AddType" code block in your question. Its .woff (2 f's).


Try this:

@font-face {  font-family: 'Proxima Nova';  src: url("./fontsproximanova-light-webfont.eot");  src: url("./fontsproximanova-light-webfont.eot?#iefix") format("embedded-opentype"), url("./fontsproximanova-light-webfont.woff") format("woff"), url("./fontsproximanova-light-webfont.ttf") format("truetype"), url("./fontsproximanova-light-webfont.svg#ProximaNovaLight") format("svg");  font-weight: 100;  font-style: normal;}@font-face {  font-family: 'Proxima Nova';  src: url("./fontsproximanova-reg-webfont.eot");  src: url("./fontsproximanova-reg-webfont.eot?#iefix") format("embedded-opentype"), url("./fontsproximanova-reg-webfont.woff") format("woff"), url("./fontsproximanova-reg-webfont.ttf") format("truetype"), url("./fontsproximanova-reg-webfont.svg#ProximaNovaRegular") format("svg");  font-weight: normal;  font-style: normal;}

The AddType directives are for getting the server to send the font files with the correct MIME type headers (so that the browser knows how to interpret them), and will not help with 404 errors. The 404 indicates to me that the urls in the CSS are incorrect.

Let me know if it works.


I would just like to add, as this issue haunted me, Apache has an alias for /icons/ as part of /etc/httpd/conf.d/autoindex.conf