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

What are some tools are available to optimize my website?

There are many great tools to optimize your website. There is an optimize tool in your hosting...

Updating an Old Docker Version to Community Edition

The following was used to upgrade an antiquated version of docker to the newest community edition...

Error 508 / 503 - Resource Limit Reached

To help maintain the stability of servers and keep websites fast, UltraWebHosting has resource...

What is a virtual Domain?

A virtual domain is the base URL of the domain name. Examples include yourdomain.com, and...

When I upload an htaccess file it disappears

On unix/linux systems, files that start with a . are considered hidden so many ftp programs do...