Mobile app version of vmapp.org
Login or Join
Samaraweera270

: Noob question - regarding images on webserver not loading when URL is typed, but do when clicked from link on index html I have dabbled with html in the past and to a very small degree some

@Samaraweera270

Posted in: #FileManager #Filenames #Permissions #WebDevelopment #WebHosting

I have dabbled with html in the past and to a very small degree some CSS.
All i am trying to do at this moment is have a website/webserver which stores one image. (The image will be retrieved by an Android game i have developed)

I have made a very simple index.html just for the sake of it really (and because after uploading my image to the server, I got the error: FORBIDDEN 404)

so long story short, there is a link on the index.html to the image url. If I load the page then click the link the image loads up and I can see the url is what I expected it to be. But if I type the URL into browser directly it doesn't display (gives 404 FORBIDDEN) -- of course the game isn't able to retrieve it either as I have tested.

I have checked the Permissions of the files and folders. They were all on 755. But I read somewhere maybe it was better the actual files go onto 644, which is how I currently have it (so folders 755 / files 644). Neither way did it work.

Strangely, sometimes if I type the full image url INCLUDING at front, it sometimes loads ?!?!???

here is the link to the website if you'd like to see what i mean:
homepage and directly to image files url

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Samaraweera270

2 Comments

Sorted by latest first Latest Oldest Best

 

@Moriarity557

after much trial and error I found my problem.

Yes the links are incorrect now but that was nothing to do with it, I'd triple checked the links at the time but have tried 3 or more new domain names and hosting services.

The problem was 100% the free hosts I chose (I tried at least 4 of the top slots of Google), the all blocked the images from being retrieved by my game (i think its called hotlinking)

Anyway, I solved my issue very easily by joining: Githubpages.io

I have my content online for free and I control the URL name so its perfect.

If that wasn't an option, I guess I would have had to join a paid host after making them verify that this hotlink blocking wasnt in the T&C's

10% popularity Vote Up Vote Down


 

@Murphy175

The problem you are having is related to case sensitivity on a unix filesystem, as well as an incorrect file extension.

In your HTML you have the filename thisWeek.png however you are linking to thisweek.jpg, these are two different files.

Fixing the filename causes the image to load. Watch your case as well. thisWeek.jpg and thisweek.jpg are different.

View the image of the site with the chrome edits I made below:



UPDATE:

It appears that your 403 issue is intermittent and this is a common problem on the free host you are using, awardspace. They have file and word filtering on their servers that gets triggered by some images and words. See this link awfaq.awardspace.info/?The_FAQ_Supplement:Server_Error_Messages:I_get_a_403_-_forbidden_error%21

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme