glossary pixel.gif (807 bytes) relative URLs

A URL is an address for a web page or a resource used within a page such as an image. When you are referencing pages or resources within your own site, you should use relative URLs, which define the address relative to the position of the current page. For example:

  • page.htm addresses a file in the same folder as the current page
  • ..\page.htm addresses a file in the folder one level back from the current folder
  • folder\page.htm addresses a file in a folder within the current folder
  • ..\folder\page.htm addresses a file in a different folder stemming from the folder one level back
  • ..\..\page.htm addresses a folder two levels back from the current folder

The advantage of relative URLs is that pages and even whole sites can be moved to different places on the same server or to completely different servers, without upsetting the links. However, when you are linking outside your site, you will need to use absolute URLs.

top

© Fastrak Consulting Ltd, 1998