General Information about URLs
and
Relative and Absolute URLs

Prerequisites:

Basic browser skills

Purpose:


The ability to travel from one site to another with the ease of a single click is perhaps the most elegant and captivating aspect of the World Wide Web. This Internet magic is made possible through the use of the Internet addressing structure known as URL (Uniform Resource Locator).

URLs make it possible to direct both people and software applications to a variety of information, available from a number of different Internet protocols. Most commonly, you will run into URLs when using a World Wide Web (WWW) client. In your WWW browser's "location" box, the item that generally starts with "http:" is a URL. Files available over protocols besides HTTP, such as FTP and Gopher can be referenced by URLs. Even Telnet sessions to remote hosts on the Internet and someone's Internet e-mail address can be referred to by a URL.

A URL is like your mailing address; it specifies all the information necessary for someone to address an envelope to you. However, they are much more than that, since URLs can refer to a variety of very different types of resources. A more fitting analogy would be a system for specifying your mailing address, your phone number, or the location of the book you just read from the public library, all in the same format.

Local links let you browse items contained locally on your hard drive or a floppy disk. The line below is a URL for a local file. The part in red is the name of the file. Notice it contains no spaces in the name and it ends with the html suffix.

 


This URL is known as a relative address. A Relative URL is one in which the link states only the file or image name. If the Web browser is given no other addressing information, it looks for this file or image in the folder that holds the current file or image. However, if someone wished to access this file from some other page or somewhere else on the Web, they would need to use the complete address or the Absolute URL as shown below.

 

back to the top


The U.S. Postal Service and the Internet

Lets take another look at how the URLs are like the postal address that you find on your mail. When the mail is delivered to your home address (assuming it has not been burned or stuffed in a sewer), it has been done so only because the sender has included all of the critical routing information. This information includes:

Your name.
Your street number; your street name.
Your city name; your state; and lastly your zip code.

The information on the envelope is arranged from the specific to the general--your name being very specific to your state being very general. This is very much like how an Absolute URL is set up. The first information (http) tells you the protocol that is being used, then the name of the computer and next the domain information.

The domain refers to the name and type of institution that operates the computer.

 

However, when you reach in your mailbox and pull out the mail, you disregard all of the address information except for the name. You check to see if the mail was sent to you, your spouse, your child, or occupant. This is like a Relative URL. Since you know the people you live with, it is not nessecary for you to read the entire address, you merely need to see who specifically this piece of mail is addressed to.

Computers don't have streets or states dividing up their hard drives, but they do have information stored in different folders and some large institutions have different servers. Managers of servers store files, images, sounds, movies and more in various folders on their computers. These folders may be placed in other folders. Since a server may have thousands of files to offer clients, this system of folders in folders makes it actually quicker for the client's browser (Netscape, for example) to locate a desired file than to have all files in one folder. The price paid for this improved retrieval system is that the URL must include accurate and complete folder references.

 

back to the top


A tip for moving from one folder to another

One of the more tricky URLs to write is one that directs the browser to look for a file that is above (hierarchically) the current html page you are viewing. Already in your browsing and looking at source pages you may have come across "../" in various URLs. This entry in the URL directs the browser to move up one folder. Thus, a relative URL like <IMG SRC="../../graphics/linc_topichome.gif" </A>, tells the browser that the desired graphic will be found two folders up in the chain.


To see how a URL is formed

I have a server set up at Highlands School in Naperville where I teach. My partner and I have set up several folders, one for each classroom. Our class is called PIPlus, and we have split all of our files into two folders: one for the science and math topics labeled science, and one for the humanities labeled lit. The science folder has other folders inside of it.

Notice how the name of the computer server and the domain it resides in is separated by dots. The folders and the file itself are separated by slashes "/".

I am trying to link to lever.html; can you write the URL to link to this file?

Click here to see how the absolute URL should be written.

 

Here is another situation you should try your linking skills on. I want to place a link on my lever.html page that links to a page on gravity in my earth folder. The page I want to link to is called gravity.html. What would this link look like?

Click here to see how the URL should be written.

back to the top