I am trying to allow access to every subdomain on my site in order to allow cross AJAX subdomains. Is there a way to specify all subdomains of a site like *.example.comor, alternatively, why the following does not work if I have multiple domains:
header('Access-Control-Allow-Origin: http://api.example.com http://www.example.com');
I read the following question, which seems similar, if not the same as this, except that I want to access the subdomains, and this applies to shared domains.
Access-Control-Allow-Origin Multiple domains of origin?
If the above question is the solution to this problem, then how can I get the source from the header. It seems that $ _SERVER ['HTTP_ORIGIN'] is a very unreliable and not even a cross browser. I need to see the source in any browser that may show an error when trying to send an AJAX call using javascript.
source
share