Uniform resources locators (URLs) are a way of unambiguously describing the locations of Internet resources.
The uniform resource locator (URL) is a fundamental part of the Web. It is utilized to unambiguously describe and identify both the protocol used by and the location of Internet resources. In general, a URL has the following form:
scheme://"common syntax"/path
Using URLs as a standard, Internet client programs like Web browsers can interpret URLs and retrieve the desired information. URLs describe the protocols and locations of Internet resources without regard to the particular Internet client software the user is employing to access them.
Each of part of a URL (scheme, "common syntax", and path) are described in the sections below.
- User names and passwords
- It includes options for user names and passwords. Names and passwords are delimited with a colon (:). This is useful for those FTP services using the word "guest" as a part of the log on procedure as opposed to "anonymous". Similarly, this is useful for instructing the end-user on how to log into a remote telnet sessions. The user name and password combination are then delimited from the balance of the "common syntax" by the at-sign (@).
- Host
- The Internet name or IP (Internet Protocol) address are the next part of the "common syntax". Examples include "sumex-aim.stanford.edu", "ftp.lib.ncsu.edu", or "152.1.24.177".
- Port
- Internet communications take place over "ports". Ports represent a section of a communications band available from the Internet protocols. Think of them like telephone number extensions. Many times you are given a telephone number with an extension (1 800 555 1212 x1234). You know this means to call the 800 number and ask for extension 1234. Internet ports work the same way where you communicate with a remote machine (152.1.24.177) and ask for a connection to port 80, or some other port. In most cases, the port number is assumed given a particular scheme. For example, the telnet protocol assumes you want port 23. Gopher assumes port 70. HTTP assumes port 80. WAIS (and Z39.50) assume port 210. But sometimes a information-service provider may not have the authority or does not want to use the standard port for their information service. In these cases, a port number must be specified and it is proceeded with a colon to separate it from the rest of the "common syntax." A good example includes the Geographic Name Server that resides at martini.eecs.umich.edu on port 3000 so it would be denoted as martini.eecs.umich.edu:3000
ftp://hostname.edu/folder/subfolder/sub-subfolder/filename.txtIn other words, this URL specifies the location of a file named "filename.txt" residing in the directory "sub-subfolder", which is in the directory "subfolder", which is in turn in the directory "folder."
Here is a real world example:
ftp://ftp.lib.ncsu.edu/pub/stacks/alawon/alawon-v1n04This URL denotes the following actions:
You do not have to specify the filename of a FTP-based URL. You only have to specify the directory path. In doing so, you must end your URL with a trailing slash (/) as in:
ftp://ftp.lib.ncsu.edu/pub/software/mac/If you do so, then the URL tells your URL-capable application to simply list all the files in the designated directory. Incidentally, you do not have to specify a path statement in an FTP-based URL either. By omitting the path statement, your Internet application should retrieve a list of the filenames of the root directory of the remote FTP archive.
http://www.lib.ncsu.edu/stacks/alawon-index.htmlThis URL opens up a HTTP connection to www.lib.ncsu.edu, changes the directory to stacks, and retrieves the file alawon-index.html.
Sometimes the path statements of HTTP-based URLs contain path and/or search arguments. The United States dollar sign ($) and the question mark (?) are used to denote these elements, respectively, as illustrated below:
wais://host:port/database?query"Port" is assumed to be 210 (the standard WAIS/Z39.50 port), "database" is the source file to search, "?" delimits the database from the query, and "query" is the your search strategy. Here is an example of a URL for a WAIS search:
wais://vega.lib.ncsu.edu/alawon.src?nren
gopher://gopher.lib.ncsu.edu/11/library/Notice the pair of 1's after the Internet name of the computer. These 1's specify the resource as a directory. On the other hand, the following URL specifies a specific text file within that directory:
gopher://gopher.lib.ncsu.edu/00/library/aboutThe "00" denotes a text file. Constructing URLs is more difficult when the path and/or file names of the Internet resources contain special characters like spaces or colons. In these cases, escape codes must be used to denote the special characters. For example:
gopher://gopher.lib.ncsu.edu/0ftp%3amrcnext.cso.uiuc.edu%40/pub/etext/etext91/aesop11.txtThis long URL first asks a gopher server (gopher.lib.ncsu.edu) to FTP a file (aesop11.txt) from an anonymous FTP server (mrcnext.cso.uiuc.edu). Notice the "%3a" and "%40" in the URL. They are used to denote a colon (":") and at sign ("@"), respectfully. Furthermore, notice the zero proceeding the "ftp." This is used to identify the remote file as a text file.
As you can see, gopher URLs are particularly difficult to decipher. The easiest way to construct a URL for a gopher item it to access the gopher server via a Web client, traverse the gopher menus until you locate the resource, and then copy the displayed URL from the appropriate part of your client's screen.
This page was first published on September 26, 1995. Feel free to send comments.