1. Home
  2. Hosting Management
  3. Troubleshooting
  4. How to enable Cross-Origin Resource Sharing (CORS)

How to enable Cross-Origin Resource Sharing (CORS)

Cross-Origin Resource Sharing (CORS) is a specification that enables truly open access across domain boundaries. If you serve public content, please consider using CORS to open it up for universal JavaScript/browser access.

CORS introduces a standard mechanism that can be used by all browsers for implementing cross-domain requests.

To enable it, set CORS header to the .htaccess file, by adding the following line of code:

<IfModule mod_headers.c> 
Header set Access-Control-Allow-Origin *
</IfModule>

Are you tired of slow web hosting? We use LiteSpeed caching to deliver content to your visitors almost instantly. ⚡ Check out our web hosting plans!

Updated on April 13, 2022
Was this article helpful?

Related Articles

Back to Build Sale!
Save Up to 84% on Web Hosting + Free Migration
👉 View Deals

Leave a Comment