I have a subdomain "x.domain.com" which then calls files from the static file subdomain "y.domain.com".
In my config file I have:
require_once("/var/_BACKEND$/functions/cors.php");
This includes the file fine. The contents of "cors.php" is the code contained in the answer for this question: CORS with php headers (I have tried searching this problem!!)
In the bottom of the config file I also have the code:
if(!function_exists('cors')) die("err"); else cors();
Now for some reason, despite the code being exactly as it is above, and the file including fine, I am still receiving the following error from the Browser:
XMLHttpRequest cannot load http://y.domain.com/scripts/ajax.php. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://x.domain.com' is therefore not allowed access.
Using a header checker also brings the following results:
The 302 is intentional.
This all appears as it should