Professional Web Site Design by Kaufman Web Design
About Our Company
Our Services
Our Process
Portfolio and More
Contact Us
Return to Home Page
Serving Raleigh, Durham, Chapel Hill, NC
 

Absolute Linking vs. Relative Linking


When making links within a web site, it is important to understand the two types of linking techniques: relative and absolute.

Relative linking is where you link to a file "relative" to where your page is. For example, if you are creating a services page for your company and you are linking to a contract you want users to read, you can link to the file like this:

contracts/customer-contract.htm

What this link is doing is looking in the contracts folder of the site and displaying the customer_contract.htm web page. The real power of relative linking is that you can move your whole site to a new location and all the links within the web site will still work.

With absolute linking, you are including your entire URL in the link. For example, a link to the same contract page as mentioned above using absolute linking might look like this:

http://www.yoursite.com/contracts/customer-contract.htm

This link will work fine but, should the company adjust their domain name down the road, then every link like this one would have to be corrected. In general, when creating a web site, you want to use relative linking within the site itself. Links from page to page and links to graphics should all use relative linking. Of course, if you are linking to an outside source, for example to download the Adobe Acrobat Reader, then you have no choice but to use an absolute link since the information is not within your site.

As a side note, most of the professional HTML authoring software out there does much of the code linking for you. The visual design tool in Macromedia Dreamweaver lets you set up your links easily without having to code them in HTML and if you have to drag and drop web pages to different locations in your file structure, the tool will notify you of any links that would break and offer to automatically fix them.

Finally, if you want a free tool to check your site for any broken links, go to: http://www.snapfiles.com/get/xenulink.html and download Xenu Link Sleuth. This tool can automatically scan a site and let you know of any broken links it finds. This is a great tool to have in your arsenal. So remember, use relative linking whenever possible, and to save time, let your authoring tool handle the HTML linking aspect, since it can save you serious effort.

- Kaufman Web Design™

Quick LInks