I am working on a wordpress website and I have installed mautic plugin into the website. Now issue is that I am getting the following error in the console. Cloud flare is also enabled.
Access to XMLHttpRequest at 'https://mautic.my-domain.com/mtc/event' from origin 'https://www.my-domain.com' 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.
I have tried different solutions for the issue but never get rid of this error. I have tried by removing the trailing slash (/) from the domain name. I have also used the " Header set Access-Control-Allow-Credentials: true Header set Access-Control-Allow-Origin 'https://www.my-domain.com' "
I have read many threads here at stack overflow, github and mautic forum but Still looking for the solution. Please help in this regard and thank you in advance
In Mautic
Configurations > System Settings > CORS Settings
either set it to NO in order to not restrict domains, or set it to YES and Add domain you want to allow.