World Wide Web Addressing: HTTP Uniform Resource Locators (URLs)
(Page 3 of 3)
Resource Paths and Directory Listings
The <url-path> used to reference a particular document can also be omitted. This provides a convenient way for a user to see what content is offered on a Web site without needing to know what particular document to request. For example, a user who wants to just see what the current headlines are on CNN would just go to http://www.cnn.com. In this case, the request is sent to the Web server for the null document / (which is implied if it is not specified; technically you are supposed to specify http://www.cnn.com/).
How such a / request is handled depends on the server. Technically, such a request is actually asking the server please show me the contents of the root directory of the server. However, this is both ugly (a listing of file names is not the best way to make a first impression) and a potential security issue (as anyone can see the name of every file on the server). Instead, most HTTP servers are set up to automatically recognize such requests and return a default document, often named something like index.html or default.html. Many servers will similarly return a default document of some sort if any other directory is specified in a URL; for example, http://www.pcguide.com/ref actually returns http://www.pcguide.com/ref/index.htm.
The forms above apply to absolute HTTP URLs. URLs may also be relative; this is the norm for links between closely related documents, such as graphics that go with a document, or between documents in a set or project. In this case, usually only a fractional portion of a URL path is specified; this is described fully in the topic on relative URLs.
Note that while it is technically incorrect to leave the http:// off an HTTP URL, most Web browsers will add it automatically if omitted. As a result, many Web users are in the habit of entering URLs that are simply a host name, such as just www.pcguide.com.
Home - Table Of Contents - Contact Us
The TCP/IP Guide (http://www.TCPIPGuide.com)
Version 3.0 - Version Date: September 20, 2005
© Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.