0

Exactly as described here, I add this thing to httpd.conf:

<IfModule mod_headers.c>
  Header add Access-Control-Allow-Origin "*"
</IfModule>

As it is described in w3.org, I tried all places: <Directory>, <Location>, and <Files>... After every change, I restart Apache, load js file and look at its headers in DevTools - there is no header I wanted to add there.

What am I doing wrong?????

shal
  • 2,854
  • 4
  • 20
  • 31

1 Answers1

0

just fi: Headers are client side interpreted.

If you don't see the header response from the server try with "always" modifier:

Header always add Access-Control-Allow-Origin "*"

When testing use a non-caching browser, like curl, so you don't get cached responses from your browser.

Also defining a directive, if you for example define it in one virtualhost and land in another, you won't see the header. So make sure you are defining it in server config (not virtualhost) or the virtualhost where your requests is landing.

Daniel Ferradal
  • 2,727
  • 1
  • 13
  • 19