Skip to content Skip to sidebar Skip to footer

Font-face Doesn't Work On Hosting Provider

I have problem when I am hosting a web site: before hosting when i run web site locally in my computer the font was fine, but when hosting it, font doesn't work. (I use font for pd

Solution 1:

The web server for your hosting provider does (probably) not send the correct Content-Type header for the fonts, and as a result your browser refuses to load them.

You need proper content type headers for fonts to work.

Can you inspect the response headers for the .woff2 files in the 'Networking' tab of your browser's dev tools?

devtools http headers

If it's indeed missing (compare headers with local hosting), that's the problem. You need to get that server to insert http header Content-Type: font/woff2(*). And that will depend on your hosting provider. Maybe some will allow to do that in a .htaccess that you can install yourself in your site.

(*) edited: previous suggestion was application/font-woff2. See this answer, there are many others on that topic.

Post a Comment for "Font-face Doesn't Work On Hosting Provider"