0

I'm using ajaxto communicate with my server from a device. Whenever I use the browser in incognitus mode the website service just won't work console.logging the following Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at URL. (Reason: CORS header 'Access-Control-Allow-Origin' does not match 'URL'). However, this works just fine if the browser is not in incog. mode. Does anyone have any idea on what the problem might be? Thank you very much for your help

Fane
  • 1,978
  • 8
  • 30
  • 58
  • please google that error ... issue comes up daily here and is not hard to research – charlietfl Jan 15 '16 at 15:18
  • @charlietfl please do note my question regards why it wouldn't work in anonymous mode, not only about the same origin policy – Fane Jan 15 '16 at 15:22
  • Possible duplicate of [Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at](http://stackoverflow.com/questions/24182259/cross-origin-request-blocked-the-same-origin-policy-disallows-reading-the-remot) – alistaire Jan 15 '16 at 15:29

1 Answers1

0

If website address is www.xxx.com you are requesting from xxx.com. just add www. Or if website address is xxx.com you are reqiesting api response from www.xxx.com. please check

Dinesh Sharma
  • 658
  • 8
  • 13
  • This seems to be it. How can I make it so I accept requests from bot .xxx.com and www.xxx.com in PHP side? – Fane Jan 15 '16 at 15:21
  • Mostly website are either on www or without www. As it is better for seo purpose . For seo same page cannot have different url and search engine treats www and without www as different pages . if you want to change go to cpanel and under url redirection and define or change your redirection – Dinesh Sharma Jan 16 '16 at 05:22