REQUIRED IMAGE

REQUIRED IMAGE

commentary

Training, Links

published by
Carnegie
 on July 19, 2000

Source: Carnegie


You have three options when you set links in HTML—an absolute path, a document-relative path, or a site-root-relative path. Consider the following descriptions to determine which link type is best for your site and for the kind of link you are creating in your document.

Absolute paths are complete paths, such as http://www.ceip.org. You must use an absolute path when you link to a page on another web site, but you should avoid using the complete address to link to pages within the same site. Absolute paths require an entirely new call to the server to retrieve the intended page and can cause longer load times.

Document-relative paths are relative to the directory containing the current document. Document-relative paths are often the simplest paths to use for links to files that will always be in the same directory as the current document. For example, if I want to link from one publications page to another, let's use Repairing the Regime, I would only need to type RepairingtheRegime.asp in the Link field.

Site-root-relative paths should be used when linking to pages within the site, but outside of the same directory. These links begin with a forward slash, indicating the site root (or top-level directory) of the server. All files visible to the public on the site branch from the site root. For example, the path /files/about/about_employ.asp links to a document named about_employ.asp in the files directory, which is the root level (or top level) of the site.

Carnegie does not take institutional positions on public policy issues; the views represented herein are those of the author(s) and do not necessarily reflect the views of Carnegie, its staff, or its trustees.