Webserver directory index
|
When an http client (generally a web browser) requests a url that points at just a directory rather than at a file within a directory the web server will generally serve up some kind of main or index page.
index.html is the tradational filename for such a page but most decent webservers will allow a list of filenames to be configured. If a server is set up to support server-side scripting then there will usually be entries (for example: index.php, default.asp) in the list to allow for dynamic content to be used as the index page. In the popular opensource web server Apache the list of filenames is controlled by the DirectoryIndex directive in the configuration file.
If the webserver cannot find a page with any of the names its set to try then it may either return an error (generally 403 forbidden) or create its own index page of the files in the directory.
In order to allow relative links to work correctly the url for a directory must end with a slash. If it does not then most webservers will send a http redirect to add the /.
http://www.mysite.tld is not really a valid url but almost all browsers will turn it into http://www.mysite.tld/ automatically and this will then result in the serving up of the index page from the root directory of the website.