Web Site Directory Structure

Discussion in 'HTML & Website Design' started by mpls-web-design, Jun 21, 2007.

  1. #1
    Can anyone explain what ../ really means in term of web site directory structure?

    Say if I have a 1 files and 1 folder in my website's root directory:

    index.htm
    images (folder)

    If I want to refer to an image from the index.htm file, I always thought I should use:

    images/picture.jpg

    But lately, I have seen a couple of sites that refer to images this way:

    ../images/picture.jpg

    and it works. ../ means one directory up or the parent directory, which in this case doesn't exist. Why does this work on the website?

    Thanks in advance!
     
    mpls-web-design, Jun 21, 2007 IP
  2. briansol

    briansol Well-Known Member

    Messages:
    221
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    #2
    ../ = one level down
    ./ = same level
    / = server root


    i'd suggest using /rootdir/image.gif as much as possible. this keeps everything portable, especially when you start messing with includes.
     
    briansol, Jun 21, 2007 IP