Fonts don’t work using @font-face with CDN, even with .htaccess
ankur_chauhan said 1 year, 1 month ago:
Hi
I wanted to use custom fonts and use @font-face on my site.
I did it successfully but it doesn’t work with CDN.
Its because of the problem called cross browser security. My CDN provider gave me solution as on this page :
http://support.netdna.com/pull-zone/working-webfonts-with-cdn/
I even searched the net and found that it works but its not working for me. I have added these lines in my .htaccess files but it doesn’t work.
Currently I have to use full path for my fonts like:
font-family: ‘ProximaNovaRegular’;
src: url(‘*http://techeverytime.com/wp-content/themes/eleven40/*
fonts/proximanova-regular-webfont.eot’);
But this does not use CDN ( hence its slow). pls help.
Regards
Gary A said 1 year, 1 month ago:
@ankur_chauhan
Since you are attempting to load the fonts from another hosting service, I’m not sure how to best assist you. If you made their recommended changes to your .htaccess file, you may want to continue working with them to determine if there are any other changes you may need to make. Another member of the Forums may be more familiar with what you are attempting to do and may be able to offer some additional advice.
-Gary
Nate D said 1 year, 1 month ago:
@ankur_chauhan – The server that holds the fonts would need to have this permission, not the server that holds the website which asks for these fonts. So the code should be added to the .htaccess of your CDN account.
ankur_chauhan said 1 year, 1 month ago:
The fonts are now working with CDN. The .htaccess did the job for me. I dont know why were they not working before
@nate: I added htaccess to godaddy and not CDN
Nate D said 1 year, 1 month ago:
Nope, the .htaccess has nothing to do with it now. But I’ll tell you what did work… you have since moved the CSS file to the CDN, and it is now no longer a cross-domain reference (the CSS file is referencing the fonts on the same domain).
Gary A said 1 year ago:
@ankur_chauhan
I’m glad to hear that you were able to get the fonts working. If you have any other questions, please feel free to post them on the Forums.
-Gary
5 min expected wait time