0

When my website first time loaded the fonts are not loaded. I'm receiving following errors

Font from origin 'https://locohop.com' has been blocked from loading by 
Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' 
header is present on the requested resource. Origin 'http://locohop.com'
is therefore not allowed access.

I lots off googling and this question is already asked on stackoverflow

I follow all the steps given in above question but fonts are not worked correctly. and I am using AWS EC2 instance

Here is my CORS configuration

<CORSConfiguration>
    <CORSRule>
        <AllowedOrigin>https://www.locohop.com</AllowedOrigin>
        <AllowedOrigin>http://www.locohop.com</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
        <AllowedHeader>Content-*</AllowedHeader>
        <AllowedHeader>Host</AllowedHeader>
    </CORSRule>
</CORSConfiguration> 

I don't know why i am getting this error? your help is greatly appreciated.

Thanks.

Community
  • 1
  • 1
Krishna Kumar Yadav
  • 313
  • 1
  • 5
  • 16
  • Interestingly you don't mention whether you've read http://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html or not, so: what happens when you use that page's simplest example? (just the allowedOrigin and allowedMethod, with a `*` header allowance) – Mike 'Pomax' Kamermans Oct 20 '15 at 16:54
  • @Mike Yes! I've read [http://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html](http://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) and also checked AllowedHeader * but font doesn't worked – Krishna Kumar Yadav Oct 23 '15 at 05:21
  • The browser says no CORS header is being sent: are you sure you made your CORS configuration take effect? – Mike 'Pomax' Kamermans Oct 23 '15 at 17:04

1 Answers1

0

You need to create a CORS policy in your .htacess

Header add Access-Control-Allow-Origin "locohop.com"
Won Jun Bae
  • 5,140
  • 6
  • 43
  • 49