Default vs index, html vs htm - what is the difference?
If you are a non-techy kind of person then name your home page either index.html or index.htm and skip the rest of this article. That should work 99% of the time for you.
Still here…?
Okay, let’s start by saying that for the most part it doesn’t matter which combination of default, index, html, or htm you use. These are just settings on the web server and can be modified.
Default and Index are the two common default directory documents. Meaning that if you don’t tell the server specifically what web page to load, it will check that directory to see if one of those two files exist and load it.
IE If your default document is index.html and you type http://www.dwkickstart.com it will load http://www.dwkickstart.com/index.html.
Note: If you ever go to a website and you get a listing of all the files in the directory and no web page, this is because they didn’t create a file to match the default directory settings AND they don’t have the privacy settings enabled. This is BAD by the way. You don’t want people to be able to scan your directory structure.
If for some reason you need to see what that setting is, it is usually the DirectoryIndex directive in httpd.conf on *nix machines and the “Enable Default Document” option of IIS.
Sometimes you can change this setting via your web control panel (plesk, cPanel) but usually you won’t have access and will have to get your hosting provider involved if you need them changed.
Note: Since this directive accepts multiple default documents, from a performance standpoint you would want to use whatever the first file in the directive is set to.
Now for “html” versus. “htm”, this is one of those things that technical purists like to argue about. I would guess the people that get uptight about “htm” files are the same people that go to a Star Trek convention and complain the doors in episode III, scene II were labeled incorrectly.
Either is fine…really… just use whatever you been using. If you want me to choose for you, then choose “html”. The “htm” extension is a holdover from back when some operating systems were limited to the 8.3 naming convention.
We didn’t even discuss extensions like “php”, “asp”, and “shtml”, so there is obviously much more you could research on this… but this falls into the “meh, who cares” category.
::ToddS
DW Kickstart - Learn to build and market your own website
Friday 15 February 2008 7:59 pm
Hmm, this is the first response to any of the questions or comments here that feels like you wrote it in a hurry, without your heart in it. It left me looking for a “rate this response” button. On a scale of 1 to 5, it gets a 3.
Friday 15 February 2008 8:47 pm
Hmmm… thanks for the candid response Prod.Net, but I’m not sure how much heart and thought you would like me to put into the technical aspects of an apache configuration file and outdated file naming conventions.
If I didn’t answer your question please let me know and I will gladly take the time to see if I can clear it up for you.
And I promise to spend more quality time with my httpd.conf file and see if we can bring the love back… Just kidding!!
Friday 15 February 2008 11:43 pm
The reason I asked this question in the first place relates back to your recommended hosting at HostGator. I registered a domain name with them, and proceeded to build…
I noticed that while their basic page at my newly created domain was a default.html, the template tool I used created a index.html which is what wqas being picked up by the browers when I went to my new domain name. This was the first time I had ever noticed a default.html and an index.html both funtioning the same.
This changed my view of how it works from certain webservers use one vs the other ( basically index vs default) to their is obviously a heirarchitcal system to it. So, while you were replying to my post, I was creating 4 files: index.htm, index.html, default.htm, and default.html. The context of each of these was simply:
index.htm this line varied based on the file name
I then went back to the domain and refreshed. Noted which file name was displayed. I then deleted that file and refreshed the browser again. I repeated this process until all four files were deleted. This gave me the order that this particular webserver uses.
Thanks for your help and the more detailed httpd.conf info.