I had the same problem. I don’t think this is W3TC specific. It will happen any time you serve fonts from a different domain to your site.
The easiest way to work on solving this issue is to first of all remove the CDN from the equation, BUT continue to serve fonts from a different domain so you can check what is happening.
So lets pretend you are using mysite.com and cdn.mysite.com
Create another subdomain like temp.mysite.com and point this at you main server (mysite.com). Now temp.mysite.com and mysite.com are both your server, meanwhile cdn.myseite.com remains you CDN.
Go in to the CDN settings of W3TC and tell W3TC that your CDN domain is temp.mysite.com
Now you should have you site loading would-be CDN content from temp.mysite.com (which is of course also your server).
Now you will probably still see the same CORS error, since the font is still coming from a different domain.
Follow the info here to fiddle with the headers of fonts (I actually found this was already implemented in the nginx.conf file the W3TC creates, but perhaps it is not for apache???).
Once you has fiddled with your nginx/apache config restart apache and see if fonts are now working from temp.mysite.com
If they are working OK then you can switch back to using cdn.mysite.com (you might need to invalidate all font files depending on your config).
-
This reply was modified 6 years ago by
mjb2000.
@mjb2000 thanks I tried those but didn’t work, then for some reason I had to restart my server it worked.
Hello @dzire2dzine @mjb2000
Glad to know the issue is resolved!
Thank you!