The Uniform Resource Locator (URL)

How do you write a link to another service on your home server, or to a different Web site entirely, somewhere else on the Internet? The answer the Uniform Resource Locator (URL), which is the unique, Internet "address" of a file or Internet service. It locates files or resources on yours or another Web server. A URL gives the type of resource being accessed (e.g., Gopher, FTP) and the path of the file. The generic URL format is:

scheme://host.domain [:port ]/path /filename

The port number usually can be omitted from the URL, as most Internet services use standard port numbers. Scheme is one of:

file:// -- a file on your hard drive, or a file on an anonymous FTP server
http:// -- a file on an Internet-connected World Wide Web server
gopher:// -- a file on an Internet-connected Gopher server
WAIS:// -- a file on an Internet-connected WAIS server
news:// -- a link to an Internet-connected news server
telnet:// -- a telnet link to open a text window on an Internet-connected server

A URL that would make the text All about Web publishing a hyperlink pointing to the HTML document publishing.html in the directory Root/Courses/Publishing on the Web server at ola.bc.ca would be:

<A HREF="http://www.ola.bc.ca/Courses/Publishing/publishing.html">
All about Web publishing</A>

Realtive and Absolute References

All the rules about absolute and relative directory paths described above, apply to URLs. Once you have pointed the browser to an HTML file, all Web browsers assume that any link on that page is written relative to the location of that page on the server. If you click on an absolute link, the Web server will take you right there.

If a relative or an absolute link is wrong, you will get the infamous message Error 404, which his has given rise to the web surfer jargon: "he (or she's) 404" for someone who is not entirely linked to reality. The Error 404 message means that either the requested file has been moved or the URL link has been written incorrectly. Check all your links carefully for 404 errors, before you finish your HTML files.


[Back] Back to Linking Documents with HTML
[Up] Up to the Contents page