Mohammad Raha Mohammad Raha - 1 year ago 49
PHP Question

Cross-Origin Request Blocked happened but all requests are to source domain

i have a problem in my site.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the
remote resource at http://example.com/index.php.
(Reason: CORS header 'Access-Control-Allow-Origin' missing).


when i search about this error, the reason was sending request to an external domain. but it's not my problem reason, because all of my request is right to the source domain.

my domain is http://example.com and all requests are to the http://example.com/index.php.

Answer Source
Access-Control-Allow-Origin: *

this might help put it in the header and if u want more than you can check.. here https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS