absolute urls for subfolders

Discussion in 'HTML & Website Design' started by fadetoblack22, Nov 3, 2008.

  1. #1
    I am going to be creating a site with lots of sub folders. In the past I have just dumped all the pages in the root and used relative urls.

    Is it common to use absolute urls on all links and image locations on a site?

    thanks
     
    fadetoblack22, Nov 3, 2008 IP
  2. new_found_glory

    new_found_glory Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I thought it wouldn't matter much --especially if I was messing around with sub-folders-- but just a few days ago I realized that hard links murder your SSL if you have https pages going on and your images are all called as absolute http:// style. That and if you change your domain or sub-folders around, you have to change all those absolute links too.

    Personally, I'd stick to relative URLs as much as you can without driving yourself up the walls. Or if you're not worried about the http https issue I can't think of how that would screw you in the long run.

    Even if you did hardcode the links, you could always use PHP to switch from http to https also I'm guessing but that defeats the point of hardcoding-for-simplicity I guess.

    Would love to know what other people think on this
     
    new_found_glory, Nov 3, 2008 IP
  3. MikeHayes

    MikeHayes Peon

    Messages:
    95
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi,

    Coincidently, I watched one of the Stompernet2 presentations yesterday about on-page things and they recommend absolute links.

    An advantage I've found is that (if and) when you set up a 'mirror' site you just need to upload the index.

    Mike
     
    MikeHayes, Nov 3, 2008 IP
  4. Sean@WMS

    Sean@WMS Peon

    Messages:
    134
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Your question actually raises several EXCELLENT issues. Really, this is an "AWARD WINNING QUESTION", IMHO.
    1. "I am going to be creating a site with lots of sub folders. In the past I have just dumped all the pages in the root"

      There are two issue here:
      1. Don't dump files into your web root. This is a classic "nube"; thing is, for every file in you web root, your server's OS needs to spend a bit more time finding the file. So don't do that; orgamize your files into subdirectories ( e.g. /imagers/ )
      2. As for relative universals, that's more a matter of SEO.
    I've A LOT more to say on this backed by a decade of experience, but I fear, I juist hilt "tilt" and need to go get some sleep.
     
    Sean@WMS, Nov 3, 2008 IP
  5. fadetoblack22

    fadetoblack22 Well-Known Member

    Messages:
    2,399
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    160
    #5
    My images are in a separate folder. Just the web pages are in the root.

    I have had problems in the past with putting relative urls in the style sheet for images, then a subdirectory calling the stylesheet file and then it not being able to find the images. That is why I was asking the question.

    Why is it a matter of SEO?
     
    fadetoblack22, Nov 4, 2008 IP