How to fix images using CDN?

Posted in: Newsmag
Post count: 115
Post count: 9544

You need to set a CORS directive for the font being loaded. Or setup exception to load the icon font locally.

See the docs for your CDN service on how to do that.

Post count: 115

Is correct?

<CORSConfiguration>
<CORSRule>
<AllowedOrigin>http://www.ohall.com.br</AllowedOrigin&gt;

<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>DELETE</AllowedMethod>

<AllowedHeader>*</AllowedHeader>
</CORSRule>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
</CORSRule>
</CORSConfiguration>

Post count: 6600

Hi,

Try the configuration below form this guide: https://coderwall.com/p/ub8zug/serving-web-fonts-via-aws-s3-and-cloudfront

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
  <CORSRule>
    <AllowedOrigin>http://www.your-site.com</AllowedOrigin>
    <AllowedOrigin>https://www.your-site.com</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedMethod>HEAD</AllowedMethod>
    <AllowedMethod>DELETE</AllowedMethod>
    <AllowedMethod>PUT</AllowedMethod>
    <AllowedMethod>POST</AllowedMethod>
  </CORSRule>
</CORSConfiguration>

Hope this helps!

Thanks

  • This reply was modified 11 years by Lucian.
Post count: 20

Hi, I added those rules changing my domain and also using cloudfront and broke my site, so had to go to file manager and delete those lines from there. I’m using wp supercache and when I enable the cdn option, although it works, many elements display as a rectangle as in Andrè’s picture. Did you find a way to fix it please?

My website is govideojuegos.com, but although the nameservers are also pointing to cloudfront cdn1.govidejuegos.com up to cdn5.govideojuegos.com, I don’t have enabled this option on wp supercache because of the above mention display problems when it is enabled.

Thank you
Jorge

Post count: 6600

Hi Jorge,

Please try the code given here instead: http://webmasters.stackexchange.com/questions/71630/font-blocked-from-loading-by-cross-origin-resource-sharing-policy-no-access-co

Let us know how it goes!
Hope this helps you!

Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.