Solved

Root-relative versus document-relative links

Posted on 2002-04-29
3
245 Views
Last Modified: 2008-02-01
Is it better to use root-relative links or document-relative links? I am writing simple HTML code, no dynamic loading of pages, and I have heard different opinions about this. It seems that if you don't expect the subdirectories to change then document-relative links should be okay. The webpages concerned are static: they are electronic versions of annual reports, etc. which have been released in hard copy, and each one consists of a collection of subdirectories containing several documents (linked to the contents.htm and index.htm pages) which should not change once they are uploaded to a website.
0
Comment
Question by:MChild
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 17

Accepted Solution

by:
dorward earned 50 total points
ID: 6977100
I generally stick to document relative, it leaves the links as portable as possible and therefore gives the most scope for any future changes.

Example: Not too far down the line somebody decides that it would be a good idea to distribute or archive these files to CDROM. With document relative links the files can be simply dumped to disc, if it was root relative then people access the disc would probably experience lots of file not found errors.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6977354
I think dorward has hit on the primary reason for keeping the links document- relative...portability.  The only time is use root-relative links is for secure
ass on intranets where I need access limitations resident on the local domains
on the local domains.

For general purpose apps an just about everything on the Internet, document-
relative, is the best way to go.

Cd&
0
 

Author Comment

by:MChild
ID: 6980076
Thanks, I will also be putting some of these onto CD so that's a good point.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
IF statment In Powershell 12 28
Non-Resizable Pharagraph 2 17
Text color and background in a text box. 2 24
Calculating percentage 2 28
This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question