SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,618
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    What is the proper way to construct a SSI?

    the top part of all my web pages are the same so I'd like to make one SSI to cover them all. The question I have is this, my site is pretty well organized (there is a link seperate folder for every link (Contact, About, Store, etc...) Each page would be linked to the same ssi in the root, how do I construct it so that all the links work (no matter where I am in the URL ie. How deep I am?
    like this?
    HTML Code:
    <img src="www.mysite.com/images/logo.gif">
    <a href="www.mysite.com/Link1">Link 1</a>
    <a href="www.mysite.com/Link2">Link 2</a>
    <a href="www.mysite.com/Link3">Link 3</a>
    or is there some way I can use a relative link instead of the super long absolute one?
    Thanks...
    "Oh, and Jenkins--apparently your mother died this morning."

  2. #2
    SitePoint Addict SirAdrian's Avatar
    Join Date
    Jul 2005
    Location
    Kelowna, BC
    Posts
    289
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML Code:
    <img src="/images/logo.gif">
    <a href="/Link1">Link 1</a>
    <a href="/Link2">Link 2</a>
    <a href="/Link3">Link 3</a>
    / goes to the root of your website.
    Adrian Schneider - Web Developer

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As SirAdrian said, or use absolute URIs:
    HTML Code:
    <img src="http://www.mysite.com/images/logo.gif">
    <a href="http://www.mysite.com/Link1">Link 1</a>
    <a href="http://www.mysite.com/Link2">Link 2</a>
    <a href="http://www.mysite.com/Link3">Link 3</a>
    A URI like 'www.mysite.com/Link1' is a relative link, pointing to the file 'Link1' in a subdirectory called 'www.mysite.com' under the current working directory.

    Absolute URIs or root-relative URIs are needed for SSI. I'd vote for root-relative URIs as in SirAdrian's example.
    Birnam wood is come to Dunsinane


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
  •