1

XMLHttpRequest cannot load https://example1.com. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://example2.com' is therefore not allowed access.

How to resolve this on apache.

D09r
  • 1,411
  • 1
  • 12
  • 16

1 Answers1

0

Header set Access-Control-Allow-Origin "*" - to open cors for all domains
Header set Access-Control-Allow-Origin "http://example2.com" - to open cors for your domain

More info you can find at http://enable-cors.org/server_apache.html.

Luger
  • 2,090
  • 1
  • 13
  • 11
  • I have added as you said, but still, error persists. **XMLHttpRequest cannot load http://example1.com. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.** I'm ran JS on XAMP to parse example1.com (for example). Any help should appreciate. – D09r Jul 05 '16 at 11:57