FAQ: what is the index.html page for?
Monday April 21, 2008
It was pointed out to me yesterday that I've never explained what the index.html page does on a website. Since nearly every site on the Internet has an index.html page, knowing what they are for and how you use them is pretty critical. Did you know that there are 3 types of default pages?


Comments
The hosting server defines the order and which pages can be the ‘default’ page. My host just upgraded me to a new server, and the information message included:
1. Directory Indexes - The new default listing for directory index files is the following: DirectoryIndex - index.htm index.html index.shtml index.xhtml index.wml index.perl index.pl index.plx index.ppl index.cgi index.jsp index.js index.jp index.php4 index.php3 index.php index.phtml default.htm default.html home.htm
I was shocked at the large number of choices there are, and surprised that index.htm came before index.html.
They also cautioned that it is not a good idea to have more than one file from this list per directory. Ideally the filename that comes later would be ‘dead’ and never be accessed, but I suppose Stuff Happens.
.htm could be displayed before .html because alot of wysiwyg editors fill this out for you and my experience with dreamweaver a few years back used the .htm extension. Nothing else to base this on, just a thought.
The first web servers were apache/unix server. Since Unix has no restriction on filename length, the logical extension was .html. Along came windows/dos with its 8.3 limitation - a document could have eight characters in the name, with a three character extension. HTML would not work, it had to be HTM.
Best practice say use index.html (always). IIS on Windows ignores the “l” in html, and it still works. The longer extension will always take precedence over the shorter.
Any page can be specified for any web server. It can be landing.php or welcome.html, for example. There are even multiple ways to set this up.
Finally, it’s possible (and a good idea) to turn off directory browsing on just about any web server. That saves the hassle of having to use an index.html page in ever single directory.