Uniform Resource Locator (URL)

Uniform Resource Locators (URLs) are used on the Internet to reference documents. A URL specifies the location of an electronic document. Most web browsers have an address box into which you can type a URL, enabling the browser to retrieve the resource to which it refers. URLs have a very specific syntax:

<scheme>:<scheme-dependent-information></p>

Examples of schemes include http and ftp. The scheme specifies the protocol used to retrieve the resource. The scheme dependent information will vary. Most schemes require a host address and the path to the relevant file. The scheme is separated from the host address by two slashes (//), and the host address is separated from the path by a single (/). Consider the following URL:

http://www.technologyuk.net/web/index.html

The scheme is http. The host address is www.technologyuk.net, and the path to the file is /web/index.html . If the path information is missing, the default document for the root directory of the site will normally be returned. If the path specifies a directory only, the default document for the directory may be returned (or possibly a directory listing, if no default document exists). Consider the following syntax:

http://<host>/<path>?<searchpart>

The searchpart (with its preceding question mark) can be used to pass information to the server (for example, to a CGI script).

URLs can be used to point to a named anchor within a document. Consider the following example:

http://www.acerimmeronline.com/anchors.html#top

A URL with a hash sign (#) and the name of an anchor appended to it will reference a specific section within the document.



FTP URLs

FTP uses the following syntax:

ftp://<user>:<password>@<host>:<port>/<cwd 1>/<cwd 2>/./<cwd n>/<name>;type=<typecode>

If contacting a site which provides public FTP access, the user and password can be omitted (including the colon between them and the @ symbol). The host is the host address of the FTP site. The port (and its preceding colon) can be omitted as well. The inclusion of <cwd 1>/<cwd 2>/./<cwd n> allows you to insert a series of change directory commands to move to the directory in which the required file resides. The name is the filename of the required file. The construction ;type=<typecode> allows a transmission method (e.g. ascii or binary) to be specified, although many clients do not support this syntax.



Electronic mail (mailto) URLs

The mailto URL scheme does not identify a file available over the Internet. Instead, it identifies the e-mail address of someone that can be reached via the Internet. The syntax is:

mailto:<account@site>

The account@site is the Internet e-mail address of the person you wish to contact. An example of its use might be as follows:

<a href="mailto:cwells@blueyonder.co.uk">E-mail Chris Wells</a>