This article describes how to enable Cross-Origin Resource Sharing (CORS) for your site. CORS enables web browsers to access resources at a different location from where the web application is running. For example, if you have an application running on https://example.com that requests resources from https://example-2.com, the server on example-2.com must allow such requests.
To enable CORS, you must configure the web server to send an HTTP header that permits remote access to its resources.
To do this, create or modify the .htaccess file in the directory where you want to permit CORS requests. Add the following line to the .htaccess file:
Header set Access-Control-Allow-Origin "*"
For more information about CORS, please visit https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS.
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
Usamos cookies con el fin de personalizar para usted nuestro sitio Web y analizar el uso de éste. Usted acepta esto haciendo clic en “Acepto” o al continuar usando el sitio Web. Hay más información sobre cookies en nuestra política de privacidad.