09 September 2010

Apache changing index.html to customized.html

Using Apache mod_dir we can define a different default page for a website. Its also possible to change under the server the default for all websites with mod_autoindex which is the responsible for the automatic index generation.

When we type a web address, http://deverasarf.blogspot.com for example, we don't specify which page we want, so Apache will look for the resources specified in the DirectoryIndex directive

We can specify more than one default name and the server will sent the first one it finds. In case the server doesn't find any of the defaults it will generate the listing of the directory.

Example of alternative indexes:
DirectoryIndex index.php welcome.php welcome.html andreferreira.html