user419017
user419017

Reputation:

http://example.com is not allowed by Access-Control-Allow-Origin

Yet it works fine for:

http://www.example.com

..and this $.post method is requesting a resource on the same server..? Any ideas?

Upvotes: 1

Views: 492

Answers (3)

Dan D.
Dan D.

Reputation: 74655

Or you could set the CORS header on those resources to allow access from http://www.example.com:80 and http://example.com:80:

Access-Control-Allow-Origin: http://example.com:80 http://www.example.com:80

Upvotes: 3

Joseph
Joseph

Reputation: 119867

subdomains are not considered the same as it's sibling subdomains, nor it's top domain. it must be that the www that is affecting it, where www is considered a "subdomain" of example.com

Upvotes: 1

Greg Hewgill
Greg Hewgill

Reputation: 994151

The two names example.com and www.example.com are different, even though they might point to the same web pages.

Upvotes: 3

Related Questions