1

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

1 Answers1

1

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. enter image description here

Mayank Tiwari
  • 919
  • 1
  • 6
  • 13
  • Also, make sure the domain does NOT include a trailing slash when entering it into the Mautic settings if you turn Restrict Domains to YES. This was the solution for the error I received on my site. – Travis Pflanz Jan 27 '23 at 21:06