The default file that gets shown when for a directory on a web server, usually index.html
The directory index is the default file that is served when URL for the directory is requested. The directory index file is usually index.html
. So for example when a client requests http://example.com/
, the server will show the contents of index.html
from the appropriate directory for that site.
index.html
is the most common file name, but web servers come configured with a variety of defaults:
index.htm
index.php
index.aspx
default.html
home.html
Most servers can be configured to use one of a list of possible default files. On Apache for example:
DirectoryIndex index.php index.html
Would instruct the server to use index.php
first if it is available and then to check for index.html
.
If no directory index file is present, servers may either show a directory-listing or a 403-forbidden error.