Cross Origin Request Error

When receiving a cross-origin / cross original request, CORS header 'Access-Control-Allow-Origin' does not match, or same origin disallow policy error you may need to add an http header to allow the request. The following two examples work in cases regarding Apache and may be used by adding one set to the .htaccess file:

 

<FilesMatch ".(js|css|xml|gz|html|eot|ttd|otf|woff)$">
Header add Access-Control-Allow-Origin "*"
</FilesMatch>

 

<IfModule mod_headers.c>
Header add Access-Control-Allow-Origin "*"
</IfModule>
  • 129 Users Found This Useful

Was this answer helpful?

Related Articles

Error 406 unacceptable

This error can be caused by several factors. One cause can be the incorrect permissions are set...

Is it possible to make a cron to backup my database at specific times?

Yes, this can be very useful for forum/message board sites with large databases. In your control...

I need a module installed but I do not have rights

No problem. Send us a trouble ticket and we will install the module as long as there are no...

Setting up Zend Framework

When setting up Zend Frameworks in your hosting account be sure to upload your frameworks folder...

Redirect http to https and www

To forward a website to use both www. and https:// use the following in an .htaccess file:...