The parts of a URL

The hostname part of the URL should be a valid Internet hostname like www.ora.com or shock.njit.edu. It can also be an IP address like 204.29.207.217 or 128.235.252.184.

The port number is optional. It's not necessary if the service is running on the default port, 80 for http servers.

The path points to a particular directory on the specified server. The path is relative to the document root of the server, not necessarily to the root of the file system on the server. In general a server, especially one open to the public, does not show its entire file system to clients. Rather it shows only the contents of a specified directory. This directory is called the server root, and all paths and filenames are relative to it. Thus on a Unix workstation all files that are available to the public may be in /var/public/html, but to somebody connecting from a remote machine this directory looks like the root of the file system.

The filename points to a particular file in the directory specified by the path. It is often omitted in which case it is left to the server's discretion what file, if any, to send. Many servers will send an index file for that directory, often called index.html or Welcome.html. Others will send a list of the files in the directory. Others may send an error message.

Section is used to reference a named anchor in an HTML document. Some documents refer to the section part of the URL as a "fragment." A named anchor is created in HTML document with a name tag like this

<A NAME="xtocid1902914">Comments</A>

A URL that points to this name, includes not only the filename, but also the named anchor separated from the rest of the URL by a # like this

http://metalab.unc.edu/javafaq/javafaq.html#xtocid1902914
For more detailed information about URLs, see


Previous | Next | Top
Last Modified J une 15, 1998
Copyright 1997, 1998 Elliotte Rusty Harold
elharo@metalab.unc.edu