Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Using the Access-Control-Allow-Origin Header
This guide helps you set up the "Access-Control-Allow-Origin" header, an HTTP header that specifies which origin (domain, protocol, and port) can access resources on a server. This header is used to control cross-origin access (CORS) from a web application.
⚠️ For additional help contact a partner or submit a request for proposal — also read the role of the hosting provider
List of Allowed Domains
You can add the origin of a request to the list of allowed domains that can access the server's resources by adding it to the values of the Access-Control-Allow-Origin
header.
To allow, for example, the site https://domain.xyz
to access resources with CORS, the header should look like this:
Access-Control-Allow-Origin: https://domain.xyz
You can set it using the header()
function in PHP by referring to this guide in particular.
If you need this header to be applied everywhere, you can use an auto-prepend.
Link to this FAQ: