by R. Glass
The Web directory structure is analogous to that of PC DOS or UNIX directories (folder for individual files). The differences between Web and PC DOS is the directory separator. The Web (and UNIX) uses a / (aka slash or forward slash or that slash with the positive slope). This differs from the PC DOS where the names are separated by \ (aka backslash or that slash with the negative slope). Web information (or files such as HTML files and images such as GIF files) can and should (for sanity sake) be stored in different directories.
Whenever a URL ends in a directory name, then the web server will look in that directory for a file (usually) called index.html (or .htm or .shtml or whatever the server is configured for). If found, then that file is sent and interpreted by the browser. (On most servers, if there is no index file then a listing of the directory contents is presented). This index.html file is referred to as the home page.
Note: The matcmp server accepts the .htm suffix while the polar server accepts either .htm or .html.
Typical Web Directory
Consider a typical Web directory structure ( figure 1 ) for a server called www.matcmp.sunynassau.edu (the colored boxes are directories and the text with lines are the files contained in those directories).
A link into this server from the outside with a http://www.matcmp.sunynassau.edu would produce the home page for the server. That home page is the file index.html located in the directory / (or root). A http://www.matcmp.sunynassau.edu/~glassr would produce the index.html file in the ~glassr directory.
It is certainly the case that these pages would provide links (URLs) and graphics to other information on this server. It is here that the URLs should be relative and not contain an http://. The URL given would be relative to the directory the page is in.
Note 1: If you know PC DOS then the directory where the page resides is the present (or current) working directory. A page (say page1.html, can just reference page2.html withoout any slashes provided it is in the current directory. Accessing files follows the same rules as PC DOS, including the .. (dot-dot specifying the parent directory) syntax, which will not be covered here. In short, .. stands for the parent so ../dir1/file.html moves up one directory and down the dir1 directory.
<A HREF="morepage.html">More pages</A>
<A HREF="~glassr">R. Glass</A>or
<A HREF="/~glassr">R. Glass</A>or
<A HREF="~glassr/index.html">R. Glass</A>
<A HREF="morestuff/morepage.html><R. Glass: More Pages</A>
<A HREF="/~glassr/morestuff/morepage.html><R. Glass: More Pages</A>
<A HREF="/morepage.html"><More Department Pages</A>
Interested in a little QUIZ?
The directory GLASSR is the directory where the user glassr can keep all the private work. It is the subdirectory called public.www (this name changes from server to server) that is really the web directory ~glassr. The same is true for /. It is the directory /sys/web/docs that is where the web directory / is really located.
The first thing you must do is create an ANCHOR NAME (it is really a label) using the <A NAME= container. Surround the text (graphic or even blank) you wish to link to. Pick a name for the label. In the sentence below, I picked the word gotohere as the NAMEd / target / anchor text.
<A NAME="gotohere">target text</A>
<A HREF="#gotohere">text or graphic</A>
Here, try it. Maybe it didn't seem to work because the anchor was still within the same screen. Move the line with the link to the very top or bottom of the screen and try it again.
<A HREF="html.htm#pages">Table of Contents</A>