Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

images don't show with certain code

Status
Not open for further replies.

inusrat

Programmer
Feb 28, 2004
308
CA
Hi,

I had a website on my web server at home.
I used to have the following code for images which used to work fine

<img src="images/summerspecial.jpg"

Now I am hosting the website on some hosting company's server. There I don't get my images though I have the same directory structure.

It works If I have it the following way

<img src="
I am just trying to understand, why is that. Why do I need to change the code.

Thanks

 
Could be one of two things that spring immediately to mind:

The path "images/summerspecial.jpg" is relative to where the page that calls it is located... so even though your images directory structure may be unchanged, is the rest of your structure unchanged as well?

if " works, then for "images/summerspecial.jpg" to work, the page would need to be in the root directory of the server. If the page URL was say " then when it tries to resolve "images/summerspecial.jpg" it will work out to " ergo 404.

Using the fully qualified path, or even the path calculated from the root will work, ie (" or simply "/images/summerspecial.jpg")

The other thing that it could be is a case sensitivity issue... "IMAGES", "Images", "images" and "iMaGeS" are not the same thing on all platforms, if you've moved from a windows to a *nix environment, it might be worthwhile checking the case of your links against the case of the actual structure.

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top