MahanGM
MahanGM

Reputation: 2382

Is this same origin policy?

I'm setting my AJAX request URL to http://www.domain.com which is the current domain that the javascript file itself is under. But if I enter with http://domain.com it'll never send request. I know this is somehow a same origin policy but the thing is I've never faced this problem until now. BTW, I'm rewriting all requests to my index.php, could it be something related? And could be the host itself that is doing this because on my localhost everything is fine.

Thanks.

Upvotes: 0

Views: 100

Answers (1)

SLaks
SLaks

Reputation: 888117

Yes; the same-origin policy will prevent that.

You should use domain-relative URLs (/a/b/c...), which will just use the current domain.

Upvotes: 1

Related Questions