Easy Web Design: Linking: Local Pages

  1. Remote Pages
  2. Linking
  3. Named Anchors

Organizing Your Site

If you have more than one page on your site, you will want to keep all of your pages in the same area of your local hard drive. Netscape can then upload them as they change. (You’ll need to use the “Publish” menu item, which we won’t go into here.)

If you have a small number of pages, you’ll probably keep them all in the same directory. If you have a large number of pages, you may wish to organize them in separate directories, but keep those separate directories grouped together under the same containing directory. When you upload the files, you will need to keep the same organization on the “real” web site. This allows Netscape Composer to correctly link to your local pages. If you keep your pages in different areas across your hard drive, then when Netscape links to them it doesn’t know where the page really is on the real web site. Often, it will assume that you are linking to a file on your local drive—meaning that only you will be able to visit the link, since only you have access to your local drive.

Linking to Your Own Pages

Linking to a page that is in the same directory as your current page is almost as easy as linking to pages elsewhere on the net. Go to the same “Insert Link” menu item or button, but instead of pasting the URL, click on “Choose File…” and select the file you wish to link to. If, for example, you are linking to a page called “gothic.html”, gothic.html will then appear in the “Link Location” box.

Try to keep your pages called “something.html”, where “something” is a very short descriptive name of what your page contains. Keep spaces and special characters out of your web page filenames. While it is possible to link to files with spaces and other special characters, it increases the chances that someone will do so incorrectly, creating broken links to your site.

When linking to pages on your site, you do not need to use the full URL. You’ll notice that when you link using Netscape Composer’s “Choose File…” button, it will link to simply the filename if the file is in the same folder as the file you’re linking from. This is a relative URL. That URL is assumed to be relative to the page the link is embedded in. If a web browser is currently displaying http://www.hoboes.com/Mimsy/ and the link is to “copyright.shtml”, the browser constructs the URL http://www.hoboes.com/Mimsy/copyright.shtml. If the page http://www.hoboes.com/FireBlade/fiction.shtml contains a link to “Wilde/”, the browser constructs the URL http://www.hoboes.com/FireBlade/Wilde/.

Your relative links can also contain the full path but leave out the hostname. Such a link begins with a slash. If the page http://www.hoboes.com/FireBlade/Wilde/ contains a link to /Politics/Prohibition/ the browser constructs the URL http://www.hoboes.com/Politics/Prohibition/.

Normally you don’t have to worry about relative links, as Netscape Composer will handle them for you when you choose your files. You must keep your local copies of your web files in the same “order” that they are on your web site for Composer to construct these links correctly, however. Your copy of your site on your hard drive should be exactly the same as your copy on your server.

Using relative links makes it very easy to move your web pages from one server to another. Since none of your relative links contain the hostname, your links will continue to work even though the hostname has changed.

  1. Remote Pages
  2. Linking
  3. Named Anchors