There
are two ways to link to other files: with either absolute or relative
URLs. An absolute URL includes the full Web address and looks
like this:
<A
HREF="http://www.domainname.com/pages/page.htm">
If
you're linking to files on your own site, however, you need to
specify only the pathname relative to the current document. In
the above example, when creating a link from the home page to
page.htm, you need to use only the following:
<A
HREF="pages/page.htm">
To
link from page.htm back to the home page (at index.htm), use this:
<A
HREF="../index.htm">
The
dots and slashes work just like DOS CD commands, except the slashes
go in the other direction. For instance, to move up three directories
and then down into the Words directory, use this:
<A
HREF="../../../pages/page.htm">
Relative
URLs have two advantages over absolutes. First, users connect
to them faster, because a DNS router doesn't have to look up the
host every time. Second, because relative URLs invoke a directory
architecture instead of host names, you can view and test such
sites from a copy of the site on your hard disk or a network drive.
This portability is especially welcome if you ever move your entire
site to a different host server.