Accessing jpg files from my website

Hi,

Sorry I’m not really sure where to put this question.

I have recently made a WebGL build of a Revision Tool for Physics. The program displays jpg files of pictures which are stored on my website in folders. The script extracts the pictures to the WebGL build and then displays them in the browser.

There is one slight complication. When typing the webpage address you must type goldenfoxgames.com/Physics/ If you type www.goldenfoxgames.com/Physics/ the WebGL build will open and the game appears to operate normally but when you click the chapter you want to revise the program is unable to download the jpgs from the webpage. Instead it delivers red ? signs on a white background in place of the jpg images.

My question: Why does having www. in front of the webpage appear to restrict access to the files and what can be done to make the files available whether the extension is goldenfoxgames.com/Physics/ OR www.goldenfoxgames.com/Physics/

My htaccess file is :
RemoveHandler .html .htm

AddType application/x-httpd-php5 .php .htm .html

Although I’m not sure that is the issue, it may be useful information.

Code which gets the jpg files:
url = “http://goldenfoxgames.com/test/” + topic + “/” + (c + 1) + “.jpg”;

IEnumerator GetPicture()
{
int a = c;
WWW www = new WWW(url);
yield return www;
if (www.isDone)
{
//Debug.Log(www.error);:wink:
loadCounter++;
if (loadCounter == total)
{
loaded = true;
}
}
Q[a] = www.texture;
}

Any help greatly appreciated.

Brent

So if you go to the website using www or not using www to load up the game, without works and with doesn’t? I suspect it probably is because of some security thing, though I can’t say for certain. I would look at your browser javascript console. (hit f12 to bring it up or look for it in your browser menu) and see if you get any errors or warnings.

You can also use log viewer on the asset store for webgl builds to view the unity console and see if you are getting any messages there.

Its not to do with my browser specifically. The same issue is repeatable on any browser. You could for instance go to the website from your browser and repeat the problem.

in the browser log it shows,

make sure you access the images with same URL as the webgl,
you get error if you access webgl page with www. and then images without www.

try,
http://goldenfoxgames.com/Physics/