I made a small gwt application and released it, but today I found a serious problem. I knew about the same problem with the original policy, so I installed the gwt application and the json application to rest on the same server. But, apparently, browsers do not consider http://www.xyz.com and http://xyz.com as the same source, so when a user lands on www.xyz.com, he cannot get data from http : //xyz.com .
This post is:
XMLHttpRequest cannot load http://xyz.com/backend/... Origin http://www.xyz.com is not allowed by Access-Control-Allow-Origin.
What is the best way to handle this? I googled and first found a .htaccess solution that does not work for tomcat. I ended up using an empty index.html landing page redirecting to url without www in it. This is not the best solution, because someone else can enter the URL from www, which is not going to index the page so that it is not redirected.
Any help would be appreciated.
source share