www and Cors issues

Hi all.

I have a simple question but following all others trheads I dont make my script work.

IEnumerator VerifyConnection()
{
WWW www = new WWW(“http://www.myDomain.com”);

yield return www;
if (www.error == null)
{
connection = true;
}
}

i create a webgl test and put this script to verify if there are connection with internet. I upload to my server in www.myDomain.com and open the page. I receive the error “unknown error” . In debug chrome I can see that my problem appear are CORS:

XMLHttpRequest cannot load http://www.myDomain.com/. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://myDomain.com’ is therefore not allowed access.

But how can I receive this error if I upload in the same domain? My webgl link will be like www.myDomain.com/webgl/index.html

I try insert " Header set Access-Control-Allow-Origin “*” " in my .htaccess, I try others links…

Where I mistake?

Thanks

oh no no no…I just remove www from link…new WWW(“http://myDomain.com”);

unbeliavable…

1 Like