# CORS error:  No 'Access-Control-Allow-Origin' header is present

**URL:** <https://forum.mautic.org/t/cors-error-no-access-control-allow-origin-header-is-present/7799>\
**Category:** Product Support\
**Created:** [March 5, 2017, 12:28pm UTC](https://forum.mautic.org/t/cors-error-no-access-control-allow-origin-header-is-present/7799 "2017-03-05T12:28:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bob](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@Bob](https://forum.mautic.org/u/Bob)\
**Post date:** [March 5, 2017, 12:28pm UTC](https://forum.mautic.org/t/cors-error-no-access-control-allow-origin-header-is-present/7799/1 "2017-03-05T12:28:48Z")

</div>

Hi all.  
  
  
  
I’m experimenting with mautic on a local server.  
  
I’ve also got a WordPress site on the same server.  
  
I’ve found the js snippet for implimenting tracking, and embedded it in the wp site.  
  
  
  
When I load the wp site, the mautic resource is successfully requested.  
  
However, the console returns a CORS error:

Code:

XMLHttpRequest cannot load http://mautic.dev/mtc/event. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://wp3.dev' is therefore not allowed access

  
I've gone back to the mautic dashboard, and gone to 'configuration' -\> 'CORS Settings'.  
At first I added the domain 'wp3.dev.' to the textfield 'Valid Domains'.  
  
I then went back to the wp site and reloaded. I still got the error.  
So I went back to mautic and togged 'Restrict Domains' off.  
Then I went back to the wp site and reloaded.  
  
Alas, the error is still thrown in the browser console.  
  
What should my next step be?

---

<div class="post-metadata">

**Author:** ![Bob](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@Bob](https://forum.mautic.org/u/Bob)\
**Post date:** [March 5, 2017, 12:28pm UTC](https://forum.mautic.org/t/cors-error-no-access-control-allow-origin-header-is-present/7799/2 "2017-03-05T12:28:48Z")

</div>

Hi all.

I’m experimenting with mautic on a local server.  
I’ve also got a WordPress site on the same server.  
I’ve found the js snippet for implimenting tracking, and embedded it in the wp site.

When I load the wp site, the mautic resource is successfully requested.  
However, the console returns a CORS error:

```auto
XMLHttpRequest cannot load http://mautic.dev/mtc/event. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://wp3.dev' is therefore not allowed access
```

I’ve gone back to the mautic dashboard, and gone to ‘configuration’ -\> ‘CORS Settings’.  
At first I added the domain ‘wp3.dev.’ to the textfield ‘Valid Domains’.

I then went back to the wp site and reloaded. I still got the error.  
So I went back to mautic and togged ‘Restrict Domains’ off.  
Then I went back to the wp site and reloaded.

Alas, the error is still thrown in the browser console.

What should my next step be?

---

<div class="post-metadata">

**Author:** ![williamknn](https://avatars.discourse-cdn.com/v4/letter/w/9fc29f/32.png) [@williamknn](https://forum.mautic.org/u/williamknn)\
**Post date:** [September 22, 2017, 3:03am UTC](https://forum.mautic.org/t/cors-error-no-access-control-allow-origin-header-is-present/7799/3 "2017-09-22T03:03:33Z")

</div>

Hello, have you solved this issue? If yes, how?

Tks.

---

<div class="post-metadata">

**Author:** ![carlconrad](https://avatars.discourse-cdn.com/v4/letter/c/90db22/32.png) [@carlconrad](https://forum.mautic.org/u/carlconrad)\
**Post date:** [October 6, 2017, 5:08pm UTC](https://forum.mautic.org/t/cors-error-no-access-control-allow-origin-header-is-present/7799/4 "2017-10-06T17:08:51Z")

</div>

I removed the trailing / from my domain name and it seems to work.

---

<div class="post-metadata">

**Author:** ![diegov](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/diegov/32/196_2.png) [@diegov](https://forum.mautic.org/u/diegov)\
**Post date:** [October 7, 2017, 7:42am UTC](https://forum.mautic.org/t/cors-error-no-access-control-allow-origin-header-is-present/7799/5 "2017-10-07T07:42:30Z")

</div>

+1 also worked for me.
