Cross-origin resource sharing (CORS)

CORS is a security system that allows restricted resources like JavaScript code, fonts etc. on a web page to be requested from a 3rd party domain outside the domain from which these resources were served. Supporting CORS from the server helps in retaining maximum control on who can access website resources.

In cases where cross-domain scripting is needed, you should add the following line in the .htaccess file of your application:

This header will instruct web browsers on how to use and manage the cross-domain content. The browser then allows access to the content based on its security configuration.

Note: You can modify/create the .htaccess file via FTP, SSH or File Manager in cPanel.

You find this article useful? Click here to learn more about SiteGround web hosting experts and what else we can do for you!