Following problem. I'm trying to call a site via ajax which has a redirection, but the request fails due to "no 'Access-Control-Allow-Origin' header" error:
XMLHttpRequest cannot load https://somesite.com. Redirect from 'https://somesite.com' to 'https://someothersite.com/index.php' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://anysite.com' is therefore not allowed access.
What I want is the redirect URL which is displayed in the error response (and which is variable). I can't seem to access it but since it's displayed in the error response I'm thinking it should be accessible somehow.
$.ajax({
type: "POST",
url: "https://somesite.com"
});
Thanks for any help.