Alternative for <BASE HREF=''> ?

Discussion in 'HTML & Website Design' started by fatabbot, Jan 21, 2007.

  1. #1
    I'm using this on all my pages, but it's causing problems when generating a sitemap. I use relative paths everywhere, with <BASE HREF=''> so all links point to the correct url on the site, but in the sitemap this BASE tag is ignored and all the links are messed up.
     
    fatabbot, Jan 21, 2007 IP
  2. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Why are you using this tag in the first place?
     
    projectshifter, Jan 21, 2007 IP
  3. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #3
    Instead of using relative paths, link from the slash. This is like linking from web root.

    <a href="/about/">About Us</a>
    <a href="/customers/help">Customer Help</a>

    This way you can put this anywhere, and it will always link to the same location :)
     
    ccoonen, Jan 21, 2007 IP
  4. fatabbot

    fatabbot Well-Known Member

    Messages:
    559
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    138
    #4
    You mean absolute paths everywhere?
     
    fatabbot, Jan 21, 2007 IP
  5. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I think you misunderstood my question. I know what it DOES, but I'm not seeing really a legitimate use for it for what you're wanting to do. Just use relative paths, or with PHP you can do a $root variable, and then make your link $root/about/
     
    projectshifter, Jan 21, 2007 IP
  6. fatabbot

    fatabbot Well-Known Member

    Messages:
    559
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    138
    #6

    Get out of my thread you :p
    He was answering my question...
     
    fatabbot, Jan 21, 2007 IP
  7. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #7
    lol but what fun is that ;) mod_rewrite is fun to use too lol
     
    projectshifter, Jan 21, 2007 IP