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

Meta Redirect

Adding this code to your web page will redirect your visitors to any address that you have...

vBulletin fsockopen() [function.fsockopen]: unable to connect

When setting up mail in vBulletin be sure you are using localhost for the mail server along with...

Heartbleed Vulnerablity, Risk and Fix

The Heartbleed bug (http://en.wikipedia.org/wiki/Heartbleed_bug) is a serious vulnerability which...

Updating an Old Docker Version to Community Edition

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

How can I change the index listing in a directory?

You can change the initial page that is sent to client requests when a directory is accessed by...