CORS policy issues regarding fonts on AWS Cloudfront

#1
Hi!

I just set up Cloudfront for my website, and it introduced an issue regarding fonts being blocked due to no CORS policy.

I have added this piece of code to my .htaccess file, in the root of my Wordpress website. Obviously mydomain.com is replaced with the actual domain.

Code:
RewriteCond %{HTTP:Origin} ^http(s)?://(.+\.)?(mydomain.com)$
RewriteRule \.(otf|ttf|eot|woff|woff2)$ - [E=THE_ORIGIN:%0]
Header set Access-Control-Allow-Origin %{THE_ORIGIN}e env=THE_ORIGIN
However, the issue still persists. How could I fix this?

Thanks,
Simon
 
Top