Index.html Apache Tobago
   HOME

TheInfoList



OR:

When an HTTP client (generally a web browser) requests a
URL A Uniform Resource Locator (URL), colloquially termed as a web address, is a reference to a web resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identifie ...
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 hardware that accepts requests via HTTP (the network protocol created to distribute web content) or its secure variant HTTPS. A user agent, commonly a web browser or web crawler, initiate ...
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, 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, 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 Server Side Includes (SSI) is a simple interpreted server-side scripting language used almost exclusively for the World Wide Web. It is most useful for including the contents of one or more files into a web page on a web server (see below), using ...
, index. jsp, default.
asp Asp may refer to: Places * Asp, part of Densbüren, Aargau, Switzerland * Aspe (''Asp'' in Valencian), Alicante, Spain * Asp Lake, a lake in Minnesota Animals * Asp (fish) * Asp (snake), in antiquity, one of several venomous snakes ** ''Cera ...
) 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 the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
web server
Apache The Apache () are a group of culturally related Native American tribes in the Southwestern United States, which include the Chiricahua, Jicarilla, Lipan, Mescalero, Mimbreño, Ndendahe (Bedonkohe or Mogollon and Nednhi or Carrizaleño an ...
, 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 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 which version fit ...
. 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 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 0.3beta (22 April 1993), which defaults to serve index.html file in the directory. This scheme has been then adopted by CERN HTTPd 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 of a website can be a menu of language options for large sites that use geotargeting. It is also possible to avoid this step, for example, by using
content negotiation 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 which version fit ...
. 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 files. 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.


Performances

When accessing a directory, the various available index methods may also have a different impact on usage of OS resources ( RAM, CPU time, etc.) and thus on web server performances. Proceeding from ''fastest'' to ''slowest'' method, here it 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