Relative vs. Absolute Links
Use Relative Links!
Why?
- An entire folder can be moved without changing the links.
- If a file is moved, Dreamweaver can help to change all relative links easily.
- Relative links can reduce work for the web browsers. An absolute link, in effect, requests the browser to go to another site. In slower Internet connections, it may take somewhat longer to reach a web page from an absolute link.
What are relative links?
- A relative link specifies the path of a document relative to the current document.
- Relative links can only be used for files on the same site. To link to files on another site, use absolute links.
Examples
The following examples are taken from the source file of "help.html" at
http://www.lib.uwaterloo.ca/staff/webmaint/help.html.
example:<a href="/index.html">
path analysis:
- "/", placed at the beginning of the path, indicates the top of the site, namely, http://www.lib.uwaterloo.ca.
- "index.html": a file in the first layer of the site structure. This is the Library Web's home page.
- Its absolute path, if referred in files on another site, is:
http://www.lib.uwaterloo.ca/index.html.
example:<a href="heuristics_analysis/index.html">
path analysis:
- "heuristics_analysis" is in the same folder, "webmaint", as "help.html". Notice that no "/" is placed at the beginning of the path.
- "/index.html" indicates that "index.html" is a file in the "heuristics_analysis".
- The absolute link, as referred in files on another site, is:
http://www.lib.uwaterloo.ca/staff/webmaint/
heuristics_analysis/index.html.
example:<a href="accessibility.html">
path analysis:
- "accessibility.html" is in the same folder, "webmaint", as "help.html".
- Its absolute path, as referred in files on another site, is:
http://www.lib.uwaterloo.ca/staff/webmaint/
accessibility.html.
Note: Contribute will enter the relative path for you. But if you are editing the ssi for the right navigation you will need to manually adjust the relative URL so it will work properly.
In the example below, the sec_navbar.html file is sitting in the ssi subdirectory. The files that the ssi is pointing to are located in the "faq" directory--one level up. Since Contribute thinks the ssi links are pointing to files in a directory one level up from the ssi it inserts ../ which means to go up one level.

When the ssi is incorporated into the file by the browser the link is actually pointing to a file in the same directory, and therefore the ../ is not needed.
For example, when the ssi on the addimage.html page is pointing to anchors.html, both files are on the same level.
If you have any queries or concerns about this page, please contact .
October 18, 2005