HOME

TheInfoList



OR:

When an
HTTP HTTP (Hypertext Transfer Protocol) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, wher ...
client (generally a
web browser A web browser, often shortened to browser, is an application for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's scr ...
) requests a
URL A uniform resource locator (URL), colloquially known as an address on the Web, is a reference to a resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identi ...
that points to a directory structure instead of an actual web page within the directory structure, the
web server A web server is computer software and underlying Computer hardware, hardware that accepts requests via Hypertext Transfer Protocol, HTTP (the network protocol created to distribute web content) or its secure variant HTTPS. A user agent, co ...
will generally serve a default page, which is often referred to as a main or "index" page. A common filename for such a page is index.
html Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser. It defines the content and structure of web content. It is often assisted by technologies such as Cascading Style Sheets ( ...
, but most modern HTTP servers offer a configurable list of filenames that the server can use as an index. If a server is configured to support
server-side scripting Server-side scripting is a technique used in web development which involves employing scripts on a web server which produces a response customized for each user's (client's) request to the website. Scripts can be written in any of a number of s ...
, the list will usually include entries allowing dynamic content to be used as the index page (e.g. index. cgi, index. pl, index. php, index. shtml, index. jsp, default. asp) even though it may be more appropriate to still specify the HTML output (index.html.php or index.html.aspx), as this should not be taken for granted. An example is the popular
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
web server
Apache The Apache ( ) are several Southern Athabaskan language-speaking peoples of the Southwestern United States, Southwest, the Southern Plains and Northern Mexico. They are linguistically related to the Navajo. They migrated from the Athabascan ho ...
, where the list of filenames is controlled by the DirectoryIndex directive in the main server configuration file or in the configuration file for that directory. It is possible to not use file extensions at all, and be neutral to content delivery methods, and set the server to automatically pick the best file through
content negotiation In computing, content negotiation refers to mechanisms defined as a part of HTTP that make it possible to serve different versions of a document (or more generally, representations of a resource) at the same URI, so that user agents can specify w ...
. If the server is unable to find a file with any of the names listed in its configuration, it may either return an error (usually 403 Index Listing Forbidden or
404 Not Found In Data communication, computer network communications, the HTTP 404, 404 not found, 404, 404 error, page not found, or file not found error message is a hypertext transfer protocol (HTTP) List of HTTP status codes, standard response code, to ...
) or generate its own
index page A home page (or homepage) is the main web page of a website. Usually, the home page is located at the root of the website's domain or subdomain. For example, if the domain is example.com, the home page is likely located at the URL www.exampl ...
listing the files in the directory. Usually this option, often named autoindex, is also configurable.


History

A scheme where web server serves a default file on per-subdirectory basis has been supported as early as
NCSA HTTPd NCSA HTTPd is a discontinued web server originally developed at the NCSA at the University of Illinois at Urbana–Champaign by Robert McCool and others. First released in 1993, it was among the earliest web servers developed, following Tim Bern ...
0.3beta (22 April 1993), which defaults to serve index.html file in the directory. This scheme has been then adopted by
CERN HTTPd CERN httpd (later also known as W3C httpd) is an early, now discontinued, web server (HTTP) daemon originally developed at CERN from 1990 onwards by Tim Berners-Lee, Ari Luotonen and Henrik Frystyk Nielsen. Implemented in C, it was the first ...
since at least 2.17beta (5 April 1994), whose default supports Welcome.html and welcome.html in addition to the NCSA-originated index.html. Later web servers typically support this default file scheme in one form or another; this is usually configurable, with index.html being one of the default file names.


Implementation

In some cases, the
home page A home page (or homepage) is the main web page of a website. Usually, the home page is located at the Root directory, root of the website's Domain name, domain or subdomain. For example, if the domain is example.com, the home page is likely l ...
of a website can be a menu of language options for large sites that use
geotargeting In geomarketing and internet marketing, geotargeting is the method of delivering different content to visitors based on their geolocation. This includes country, region/state, city, metro code/ zip code, organization, IP address, ISP, or other c ...
. It is also possible to avoid this step, for example, by using
content negotiation In computing, content negotiation refers to mechanisms defined as a part of HTTP that make it possible to serve different versions of a document (or more generally, representations of a resource) at the same URI, so that user agents can specify w ...
. In cases where no known index.* file exists within a given directory, the web server may be configured to provide an automatically generated listing of the files within the directory instead. With the Apache web server, for example, this behavior is provided by the mod_autoindex module and controlled by the Options +Indexes directive in the web server
configuration file A configuration file, a.k.a. config file, is a computer file, file that stores computer data, data used to configure a software system such as an application software, application, a server (computing), server or an operating system. Some applic ...
s. These automated ''directory listings'' are sometimes a security risk because they enumerate sensitive files which may not be intended for public access, in a process known as a directory indexing attack. Such a security misconfiguration may also assist in other attacks, such as a path or
directory traversal attack A directory traversal (or path traversal) attack exploits insufficient security validation or sanitization of user-supplied file names, such that characters representing "traverse to parent directory" are passed through to the operating system's ...
.


Performances

When accessing a directory, the various available index methods may also have a different impact on usage of OS resources ( RAM,
CPU time CPU time (or process time) is the amount of time that a central processing unit (CPU) was used for processing instructions of a computer program or operating system. CPU time is measured in clock ticks or seconds. Sometimes it is useful to con ...
, etc.) and thus on web server performances. Proceeding from ''fastest'' to ''slowest'' method, here is the list: * using a static index file, e.g.: index.html, etc.; * using a web server feature usually named ''autoindex'' (when no index file exists) to let web server autogenerate directory listing by using its internal module; * using an interpreted file read by web server internal program interpreter, e.g.: index.php; * using a CGI executable and compiled program, e.g.: index.cgi.


References

{{reflist Web navigation