I have the following in my .htaccess file:
Header set Access-Control-Allow-Origin: "*"
It works perfectly! But it is bad security practise.
When I change it to:
Header set Access-Control-Allow-Origin: "http://example.com"
I get the following error:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://example.com/oc/catalog/view/javascript/font-awesome/fonts/fontawesome-webfont.woff2?v=4.4.0. (Reason: CORS header 'Access-Control-Allow-Origin' does not match 'http://example.com').
How do I handle this?
example.comand, in the process, hidden the problem. - Quentinhttp://example.com/tohttp://example.com/and it is blocked because it isn't fromhttp://example.com/. - QuentinHeader set Access-Control-Allow-Origin: "http://arvindint.com". The error I get is -Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at arvindint.com/oc/catalog/view/javascript/font-awesome/fonts/…. (Reason: CORS header 'Access-Control-Allow-Origin' does not match 'arvindint.com').Stackoverflow seems to be removing the "http://" before the links in the comments. - user3980196Font from origin 'http://arvindint.com' has been blocked from loading by Cross-Origin Resource Sharing policy: The 'Access-Control-Allow-Origin' header has a value 'http://arvindint.com' that is not equal to the supplied origin. Origin 'http://www.arvindint.com' is therefore not allowed access.As my answer says,http://arvindint.comis not the same ashttp://www.arvindint.com. One has an extrawww.in it. - Quentin