Digg it UP
#1 in Business Subscribe Email Print

You are here: Home > Internet and Businesses Online > Web Design > Understand Site-Relative versus Document-Relative Web Links

Tags

  • knowledge
  • begins
  • engine
  • computer without
  • servers notion
  • detailed explanations

  • Links

  • Shopping for Small Business Services
  • Creating A Home Theater Space
  • Give Magazine Subscriptions: Holiday Gift Ideas
  • Digg it UP - Understand Site-Relative versus Document-Relative Web Links

    Adding To The Mix- A Brand Story
    The Key IngredientYou've heard it yourself. He's the life and soul of the place, a grand man altogether. She's the heart of the business, a formidable woman. Sometimes, it seems to me that the more successful hotels or restaurants are those that are closely identified with their larger-than-life owner or founder. In Ireland, the personalities of P.V. Doyle, Myrtle Allen and Paddy Fitzpatrick stand squarely o
    es.htm -- refers to the file sickjokes.html, which is located in the humor folder, relative to the directory of the document it is referenced in.

    ../MotherInLawJokes.html -- refers to the file MotherInLawJokes in the folder above the directory of the document it is referenced in.

    Links to the above three documents would look like this:

          <a href="comedy.html">Address of file in same director</a>
          <a href="humor/sickjokes.html">Address of file in lower level director</a><
    10 Ways To Increase Your Selling Power
    Knockout sales champions have an insatiable appetite for knowledge. They know that their customers look to them for expert advice and know it’s their responsibility to stay on top business trends, changes, and competitive activity.Part of their core competency is the acquisition of "New Knowledge," and they turn it into an art form and business discipline. They are always prepared to think through all sides of an opportuni
    The documentation in the Dreamweaver HTML Layout Editor software package talks about two distinct types of relative links in HTML, but the concepts are applicable to any web page; with or without Dreamweaver. The two types of relative links are:

    1. Site-Relative. The address of the link is relative to the overall site.
    2. Document-Relative The address of the link is relative to the address of the document the link appears in.

    It is important to understand that if you are testing web pages and sites on a computer without a web server, site-relative links probably will not work. With that said, here are detailed explanations of site relative links versus document relative links.

    Site Relative-Links

    In a site-relative link the address always begins with a forward slash -- "/". The forward slash indicates that the address is relative to the web server's notion of the site root.

    Let us suppose that your site is located at the web location:

          http://www.TotallyNonExistentSite.com

    Furthermore, let us now suppose that you want to refer to a document located at:

          http://www.TotallyNonExistentSite.com/RedDirectory/FatDirectory/Jokes.html

    Then the site-relative address of that document would be:

          /RedDirectory/FatDirectory/Jokes.html

    and, a link to that document would look like this:

          <a href="/RedDirectory/FatDirectory/Jokes.html">Relative Address of Joke File</a>

    It is important to understand that this link will work from any other document in the website, NO MATTER WHERE IT IS LOCATED! The reason is simple -- site relative links are not relative to the documents they are contained in -- they are relative to the entire website.

    Document-Relative Links

    Any relative link that is NOT a site-relative link MUST be a document-relative link. Document-relative links are links that are relative to the document that contains them. Here are some examples of document-relative links:

    comedy.html -- refers to the file comedy.html in the same folder.

    humor/sickjokes.htm -- refers to the file sickjokes.html, which is located in the humor folder, relative to the directory of the document it is referenced in.

    ../MotherInLawJokes.html -- refers to the file MotherInLawJokes in the folder above the directory of the document it is referenced in.

    Links to the above three documents would look like this:

          <a href="comedy.html">Address of file in same director</a>
          <a href="humor/sickjokes.html">Address of file in lower level director</a> SEO (Search Engine Optimization) Are People Going Mad on There Websites With This
    The more and more I look around on the internet these days the more websites I see that are nearly fully search engine optimized so this brings me to the point of my article.A fully search engine friendly webpage should consist of the following1. A good title of the page.2. A URL containing your main keyword.3. H1 H2 HTML tags for the title of the subject, which the page subject is about.4. Text
    computer without a web server, site-relative links probably will not work. With that said, here are detailed explanations of site relative links versus document relative links.

    Site Relative-Links

    In a site-relative link the address always begins with a forward slash -- "/". The forward slash indicates that the address is relative to the web server's notion of the site root.

    Let us suppose that your site is located at the web location:

          http://www.TotallyNonExistentSite.com

    Furthermore, let us now suppose that you want to refer to a document located at:

          http://www.TotallyNonExistentSite.com/RedDirectory/FatDirectory/Jokes.html

    Then the site-relative address of that document would be:

          /RedDirectory/FatDirectory/Jokes.html

    and, a link to that document would look like this:

          <a href="/RedDirectory/FatDirectory/Jokes.html">Relative Address of Joke File</a>

    It is important to understand that this link will work from any other document in the website, NO MATTER WHERE IT IS LOCATED! The reason is simple -- site relative links are not relative to the documents they are contained in -- they are relative to the entire website.

    Document-Relative Links

    Any relative link that is NOT a site-relative link MUST be a document-relative link. Document-relative links are links that are relative to the document that contains them. Here are some examples of document-relative links:

    comedy.html -- refers to the file comedy.html in the same folder.

    humor/sickjokes.htm -- refers to the file sickjokes.html, which is located in the humor folder, relative to the directory of the document it is referenced in.

    ../MotherInLawJokes.html -- refers to the file MotherInLawJokes in the folder above the directory of the document it is referenced in.

    Links to the above three documents would look like this:

          <a href="comedy.html">Address of file in same director</a>
          <a href="humor/sickjokes.html">Address of file in lower level director</a><
    Who's Got Your Back? Joint Ventures
    Entrepreneurs understand how important it is to surround oneself with strong, dependable, loyal and able people. It’s been said that, in the heat of battle, the soldiers who stand by you are not the college kids and the pretty boys, but rather the ex cons, thugs, drifters and pimps. When the bullets are flying, somehow a PhD or MBA doesn’t make much of a difference.If you were about to trek across the ice to the North Pole
    w suppose that you want to refer to a document located at:

          http://www.TotallyNonExistentSite.com/RedDirectory/FatDirectory/Jokes.html

    Then the site-relative address of that document would be:

          /RedDirectory/FatDirectory/Jokes.html

    and, a link to that document would look like this:

          <a href="/RedDirectory/FatDirectory/Jokes.html">Relative Address of Joke File</a>

    It is important to understand that this link will work from any other document in the website, NO MATTER WHERE IT IS LOCATED! The reason is simple -- site relative links are not relative to the documents they are contained in -- they are relative to the entire website.

    Document-Relative Links

    Any relative link that is NOT a site-relative link MUST be a document-relative link. Document-relative links are links that are relative to the document that contains them. Here are some examples of document-relative links:

    comedy.html -- refers to the file comedy.html in the same folder.

    humor/sickjokes.htm -- refers to the file sickjokes.html, which is located in the humor folder, relative to the directory of the document it is referenced in.

    ../MotherInLawJokes.html -- refers to the file MotherInLawJokes in the folder above the directory of the document it is referenced in.

    Links to the above three documents would look like this:

          <a href="comedy.html">Address of file in same director</a>
          <a href="humor/sickjokes.html">Address of file in lower level director</a><
    Start A Day Care - How To Cash In On The Booming Demand For Day Care Centers
    If you have been putting off starting a day care center now is the time to think seriously about it. Day care centers are out in a very big way and some savvy stay at home moms and dads are cashing in big time. Just look at the large number of women with pre-schoolers who have taken up work away from home.1. START A DAY CARE BUSINESS THAT'S PROFITABLE FROM THE START.Start small and build on your successes. Whatever
    in the website, NO MATTER WHERE IT IS LOCATED! The reason is simple -- site relative links are not relative to the documents they are contained in -- they are relative to the entire website.

    Document-Relative Links

    Any relative link that is NOT a site-relative link MUST be a document-relative link. Document-relative links are links that are relative to the document that contains them. Here are some examples of document-relative links:

    comedy.html -- refers to the file comedy.html in the same folder.

    humor/sickjokes.htm -- refers to the file sickjokes.html, which is located in the humor folder, relative to the directory of the document it is referenced in.

    ../MotherInLawJokes.html -- refers to the file MotherInLawJokes in the folder above the directory of the document it is referenced in.

    Links to the above three documents would look like this:

          <a href="comedy.html">Address of file in same director</a>
          <a href="humor/sickjokes.html">Address of file in lower level director</a><
    Hard Working Entrepreneurs - Do You Procrastinate? Want To Find Some Extra Time?
    Are you working very hard but don’t seem to be doing as much as you want to? The busiest person is not always the most effective – you could be wasting a load of your valuable time. Do you procrastinate?Signs that all is not well: If you hear yourself saying one of these... * If only I had all the facts * Every one wants a decision from me * Why don’t my staff do what I want them to? * If onl
    es.htm
    -- refers to the file sickjokes.html, which is located in the humor folder, relative to the directory of the document it is referenced in.

    ../MotherInLawJokes.html -- refers to the file MotherInLawJokes in the folder above the directory of the document it is referenced in.

    Links to the above three documents would look like this:

          <a href="comedy.html">Address of file in same director</a>
          <a href="humor/sickjokes.html">Address of file in lower level director</a>
          <a href="../MotherInLawJokes.html">Address of file in directory one level up</a>
    Conclusion

    When you move a document that contains root-relative links the links will continue to work. On the other hand, the root-relative links which refer to that document may break. In general, for working on small sites, document-relative links are preferred, and they have the additional advantage that they can be tested on a computer that does not host a web server.

    copyright 2006 Sam Mela

    HTTP = HTML link (for blogs, profiles,phorums):
    <a href="http://www.diggitup.net/article/84819/diggitup-Understand-SiteRelative-versus-DocumentRelative-Web-Links.html">Understand Site-Relative versus Document-Relative Web Links</a>

    BB link (for phorums):
    [url=http://www.diggitup.net/article/84819/diggitup-Understand-SiteRelative-versus-DocumentRelative-Web-Links.html]Understand Site-Relative versus Document-Relative Web Links[/url]

    Related Articles:

    Money Does Talk!

    Does Your Sales Division Reflect Our Diverse World?

    10 Trade Show Thanks for the New Year

    Bookmark it: del.icio.us digg.com reddit.com netvouz.com google.com yahoo.com technorati.com furl.net bloglines.com socialdust.com ma.gnolia.com newsvine.com slashdot.org simpy.com shadows.com blinklist.com

    domki holenderskie awans.radom.pl kredyty obrotowe dla firm pożyczka na samochód small loans