URL
the fundamental network identification for any resource connected to the web (e.g., hypertext pages, images, and sound files).
URLs have the following format:
protocol://hostname/other_information
For example, the URL for Indiana University's home page is:
http://www.indiana.edu/
The protocol specifies how information from the link is transferred. The protocol used for web resources is HyperText Transfer Protocol (HTTP). Other protocols compatible with most web browsers include FTP, telnet, newsgroups, and Gopher. The protocol is followed by a colon, two slashes, and then the domain name. The domain name is the computer on which the resource is located. Links to particular files or subdirectories may be further specified after the domain name. The directory names are separated by single forward slashes.
protocol://hostname/other_information
The protocol is usually http:// , but can also be ftp:// , gopher:// , or file:// . The hostname is the name of the computer. For example, the hostname of IU's central web server is www.indiana.edu. The other_information includes directory and file information. You must use absolute URLs when referring to links on different servers.
A relative URL doesn't contain as much information as an absolute URL does. Relative URLs are convenient because they are shorter and often more portable. However, you can use them only to reference links on the same server as the page that contains them. Relative URLs can take a number of different forms. When referring to a file that occurs in the same directory as the referring page, then a URL can be as simple as the name of the file. For example, if you want to create a link in your home page to the file foobar.html, which is in the same directory as your home page, you would use:
<A HREF="foobar.html">The Wonderful World of Foobar!</a>
If the file you want to link to is in a subdirectory of the directory the referring page is in, you would just need to enter the directory information and the name of the file. So, if foobar.html was in the foobar subdirectory of your www directory, you could refer to it from your home page by using: <A HREF="foobar/foobar.html">The Wonderful World of Foobar!</a>
If the file you want to link to is in a higher directory than the referring page, use .. , which means to go up a directory. For example, to link from foobar.html to home.html, which is in the directory above, you would use: <A HREF="../home.html">
Variants
- Uniform Resource Locator