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

htaccess - Allow Let's Encrypt to Validate and Renew

When receiving the following Let's Encrypt error message:domain.com: The SSL certificate expires...

How can I tell how much disk space I have available?

To see how much disk space you have available, go to your control panel and on the left side of...

When should I use ascii and when should I use binary?

Many FTP client programs support and auto mode to detect the proper upload type based on file...

How do I customize error messages for my site?

Within control panel select Custom Error Pages. Select the error code link and place whatever...

What are all these htaccess files?

.htaccess files are used to perform certain rules such as displaying a 404.shtml file in replace...