Solved

Root-relative versus document-relative links

Posted on 2002-04-29
3
246 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sending ASP to server side 8 42
HTML or/and CSS codes to construct numbered paragraphs. 5 33
Boolean 13 45
HTML 5 Input Type Numeric 5 31
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

739 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