Webserver directory index

When an HTTP client (generally a web browser) requests a URL that points to a directory structure instead of an actual web page within the directory, the web server 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 codice_1, 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. codice_2, codice_3, codice_4, codice_5) even though it may be more appropriate to still specify the HTML output (codice_6 or codice_7), as this should not be taken for granted. An example is the popular open source web server Apache, 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 make do without file extensions at all, and be neutral to content delivery methods, and set the server to automatically pick the best file through content negotiation.
If the server is unable to find a file with any of the names listed in its configuration, it may either return an error (generally 404 Not Found) or generate its own index page listing the files in the directory. It may also return a 403 Index Listing Forbidden. Usually this option 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 codice_1 file in the directory. This scheme has been then adopted by CERN HTTPd since at least 2.17beta (5 April 1994), which its default supports codice_9 and codice_10 in addition to the NCSA-originated codice_1.
Later web servers typically support this default file scheme in one form or another; this is usually configurable, with codice_1 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 geo targeting. It is also possible to avoid this step, for example by using content negotiation.
In cases where no codice_1 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 codice_14 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.