heroku-buildpack-wordpress icon indicating copy to clipboard operation
heroku-buildpack-wordpress copied to clipboard

No Access-Control-Allow-Origin Error

Open vmetayer opened this issue 10 years ago • 2 comments

I receive this error when loading external scripts. js and css. I tried adding the access control to my headers but still no luck XMLHttpRequest cannot load http://fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&ver=3.9.2. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://myapp.herokuapp.com' is therefore not allowed access.

vmetayer avatar Sep 10 '14 17:09 vmetayer

Browser refused to load the content because Google's server does not give out that header. This has nothing to do with the buildpack.

okko avatar Sep 11 '14 09:09 okko

This 1 year late, but I was having this problem with my wordpress-heroku app as well and it seems adding this line to the .htaccess file fixed it. <IfModule mod_headers.c>
Header add Access-Control-Allow-Origin "*" </IfModule>

reference link http://webmasters.stackexchange.com/questions/71630/font-blocked-from-loading-by-cross-origin-resource-sharing-policy-no-access-co

iposton avatar Sep 14 '15 23:09 iposton