SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2006
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Locate file without using entire URL

    I was thinking earlier, as i have some html pages in a sub folder of my main root, where the css script is located, is there any way to look back up a folder, as opose to having to type the entire url.

    As in you can type /vids/skydive.mpg to look in the folder vids that is in your current folder, how could i look back, towards the root folder, so i can access sit.com/website/vids and point at a file that is in the website folder. At the moment my options are to either write the full URL, which i dont want to do, because if i were to change my domain name, i would have to change all the urls, or i can put the css sheet in each folder its needed, (well, i could sneakly put it in the lowest folder, and then all the files can see it from there, providing the site doesnt start branching.

    Hope this makes some sense.

    Its the thinkings of a man who has spent a little too much time following root trees etc today

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use a relative URI, i.e., one that doesn't begin with a '/' character.

    Two periods mean 'up one directory level', just as in Unix and DOS filesystems.

    Code:
    ../vids/skydive.mpg
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2006
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool. Thanks


Bookmarks

Posting Permissions

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