Access to XMLHttpRequest to "wix page" from origin "external site"

Access to XMLHttpRequest at ‘wix page’ from origin ‘external page’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

How do I add this Cors policy header to my wix page so that when I access a url from the external page and it tries to redirect to my wix page, it won’t be blocked?

let options = {
 "headers": {
 'Access-Control-Allow-Origin': '*',
 "Content-Type": "application/json"
 }
 };

Hi,
Thank you for your answer.
In my case, I just need to add ‘Access-Control-Allow-Origin’ : ‘external domain’
and not all domains with ‘*’.

But that aside. In your case, you are just declaring a variable. Where do I add this?
I need a little more information.

Thank you.

@yunus It’s not so clear what you’re trying to achieve and what the issue is, Please elaborate,

Hi J.D.

I’m trying to redirect users from a domain of my own (non wix related) to our wix page.

When I try to access this link it won’t redirect because it is blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

So I need to add the Access control allow origin header to our wix page. That way the origin, which is my own domain, won’t be blocked by wix, and it will redirect succesfully.

How do I do this in wix?

Thanks in advance.