Plugin Support
Vytis
(@bvytis)
Hi @hsntgm,
Thank you for trying Optimole and contacting us.
You can add this to your .htaccess and it should solve the issue:
<FilesMatch ".(eot|otf|ttf|woff|woff2)"> Header always set Access-Control-Allow-Origin "*" </FilesMatch>
Make sure to clear the cache from any caching plugins, this should solve your CORS error related to fonts.
I hope it helps!
Thread Starter
hsntgm
(@hsntgm)
Hi Vytis,
Thanks for great plugin. This is a clean and simple solution to get rid of complex cloudfront interface.
I’m on nginx and I have already applied the nginx equalish one to my server. Not working. So I suppose maybe your end has issue or tiny “always” option has big impact:)
Thanks.
Plugin Support
Vytis
(@bvytis)
Hi @hsntgm,
Thank you for the confirmation but this shouldn’t be related to Optimole, it happens because of the strict content security policy on your website so no matter if it’s a resource loaded from Optimole’s CDN or any other external resource that is not your domain or not whitelisted on your website – you would be getting the same CORS errors so I would recommend checking with your hosting provider why the added lines do not work as expected as they can provide more insights.
Thread Starter
hsntgm
(@hsntgm)
You are right I just realized that problem caused where fonts comes within css @font-face and cors headers cannot applied for these inlined css fonts. What a tricky thing.
Thank you vytis.