Results 1 to 11 of 11
  1. #1

    [TIP] Images in site building

    Hello,

    I have always had a "knack" for website building and so on, so I thought I would share my "wisdom" lol.

    This is a simple tip when building a website, and should be followed to disallow the happenings I will describe below.

    Code:
    <img src=images/imagename.jpg>
    When entering

    all works fine. But when entering

    You will find that the images link to something like this;

    To prevent this happening, simply just enter

    Code:
    <img src="http://www.url.com/images/imagename.jpg">
    This helps in 2 ways;

    Search Engine,
    No matter how a user enters the "correct" URL your site will look the same.

    I often forget to do this immediately, but do it in the end process of building the website.

    -- If you have any problems let me know, and I'll try figure it out --
    ServeYourSite
    Web hosting done right
    ██ Shared, Reseller and Dedicated web hosting
    An Easy Web Presence Company

  2. #2
    Join Date
    Oct 2002
    Location
    State of Disbelief
    Posts
    22,951

    Re: [TIP] Images in site building

    Originally posted by 4 Degrees
    When entering

    all works fine. But when entering

    You will find that the images link to something like this;
    Umm, actually, that URL would give a 404, wouldn't it? Seems to me adding a slash at the end of 'index.htm' would signify that it's a directory, not a file. Since it's unlikely that you have a directory with that name, it won't be found at all...

  3. #3
    Umm, actually, that URL would give a 404, wouldn't it?
    Nope.

    For example...


    My site...




    www.mindqwerk.com/index.shtml

    and

    www.mindqwerk.com/index.shtml/

    It dipsplays the page, but you get dead links for the images.
    Something witty here...

  4. #4
    Join Date
    Oct 2002
    Location
    State of Disbelief
    Posts
    22,951
    When I add the slash to mine, it fails to find a page at all. Maybe because it's a non-dynamic page?

  5. #5
    Hmmm, maybe - I'm not sure.

    I tested that idea and it seems like that might be it - but I wouldn't know for sure, or why if that's the case. For example, any page I try it on that is html, htm, or php displays a 404 - but any shtml page just kills the images.

    Anyone know why this occurs? I would like to know out of curiosity.
    Something witty here...

  6. #6
    Join Date
    Oct 2002
    Location
    State of Disbelief
    Posts
    22,951
    Just a guess, but maybe the parser is expecting 'odd' characters after the page name?

  7. #7
    I found that the "dead images" happen on php pages too. It seems (I'm not sure if it's true) that servers with cPanel will actually display the page but pickup index.htm/images rather than /images.

    I came to this conclusion after trying on numerous ASP sites and it failing to work, hence giving a 404 as said above.
    ServeYourSite
    Web hosting done right
    ██ Shared, Reseller and Dedicated web hosting
    An Easy Web Presence Company

  8. #8
    Join Date
    Oct 2002
    Location
    State of Disbelief
    Posts
    22,951
    The sites I tested on were cpanel sites, so maybe it's a particular version/setup?

  9. #9
    Maybe so, I do find it fairly wierd how different servers respond and handle these things differently.
    ServeYourSite
    Web hosting done right
    ██ Shared, Reseller and Dedicated web hosting
    An Easy Web Presence Company

  10. #10
    damn that SLASH....i really dont use slashes anyone - at least at the end of a URL

  11. #11
    I never do - but I'm still curious, hehe.
    Something witty here...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •