Linking

One of the major advantages of the HTML format over older hyperlinking protocols was that HTML pages can contain links to other pages as part of the normal content. Any text or image in your content can be linked to any other web page on the web. You can also link it to “anchors” within the same document, automatically scrolling the page to that anchor when the viewer selects that link.

Links generally appear as colored text which change color when the viewer visits the link.

It is important to choose good, descriptive things for the reader to click on. Remember that not everyone is reading your web page from a ‘standard’ browser. Some will be having the web page read to them. Some will be reading from tiny PDAs which will summarize the links and their clickable text. Search engines also use link text to weight the linked pages.

If all of your links use the text “click here”, those summaries will be worthless to your viewers. It is better to link actual descriptive text, such as “Hoboes Web Tutorial” or “Jesus and Friends”.

If you make clickable images, you need to make those links descriptive also. Make sure you set the ‘alternate text’ for the image. See the section on images for more information.

Remote Pages

Remote Pages are the easiest to link to. Highlight the text or image that you want your viewers to select to visit the new link, choose “Link” from the “Insert” menu, and enter the URL.

What is a URL?

You must enter a full URL. When you browse the web, many browsers will guess at what you mean, but when you enter a page into a composer page you must type the full URL, beginning with “http://”, following with the hostname, and then following with the path to the page you’re linking to. The general form of most of the URLs you will use is service://hostname/path. The “service” is almost always “http” but sometimes it will be “https” (a secure web page). There are others, however, and we’ll look at an e-mail URL in just a bit.

Many hostnames will begin with “www”, but not all of them will. If you add “www” to a hostname that doesn’t contain it, it might not work. The hostname is simply the name of the computer that the web pages are served from. There is a convention to name this computer “www”, but that is only a convention and is neither required nor expected.

The path often ends with “.html” but may end with anything. The path for the main page of a particular hostname’s site is almost always “/”. Subsidiary pages will have longer paths. The following are all valid (as of this writing) web URLs:

http://news.google.com/

http://www.hoboes.com/FireBlade/Wilde/

http://www.godsmonsters.com/?IP=guide

A URL may never contain a space.

The easiest way to ensure that your URLs are correct is to visit the page in your browser and then copy the URL from the location bar.

If you can copy the URL directly from where you know that it works, you can be reasonably certain that it will work for others who visit your page. Then just paste it into the “Link Location” box.

Local Pages

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.

Named Anchors

Normally, you will not have multiple large sections on a single page. If you have multiple large sections, you’ll probably want to separate the sections out into multiple pages, one for each section. Sometimes, however, you will want to have a long page and link to different places within that page.

The easiest places within your page to link to are your headlines. Netscape automatically lists your headlines when you click on the down arrow in the “Insert Link” box.

If you choose one of your headlines from the list, Netscape automatically creates an anchor for you at that headline. (Click on Preview to see the page as it appears on the web--the yellow anchor will not show up on the web.)

If you wish to create an anchor somewhere other than at a headline, click where you want the anchor to be, pull down the “Insert” menu and choose “Named Anchor...”. That anchor will now show up in the list of possible anchors in the pull-down menu above. Your anchors should not contain spaces or special characters.

E-Mail Addresses

You can link to any Internet service that has a “protocol” abbreviation for URLs. A URL is a Universal Resource Locator. It can link to any resource that can be linked to. The web protocol abbreviation is “http”. If you ever have to link to a gopher site, you’ll use “gopher://hostname/path”, and similarly for ftp sites. You almost never see those nowadays, but you do still occasionally see e-mail address links. The protocol name for an e-mail URL is “mailto”. E-mail addresses do not require a hostname (they use your local service provider’s outgoing mail provider automatically). The form of an e-mail URL is “mailto:address”. If your e-mail address is fflintstone@sandiego.edu, your e-mail URL is “mailto:fflintstone@sandiego.edu”. There are no spaces in URLs ever, so don’t put a space in “mailto” or anywhere else in the URL.

In general, you probably want to avoid putting e-mail addresses on your web site. Spammers harvest e-mail addresses from web pages and then send spam to the address. Many service providers will have special comment form CGIs (they should have instructions on how to set it up) that can take comments without your having to make your e-mail address public.