index.htm: What’s that all about?

Screenshot of Address field
Screenshot of Address field.

When you type a web site URI (Uniform Resource Identifier, i.e. a web address) into the browser web address field and click return or enter, if everything goes smoothly you will get a web page displayed in you browser. That page is a file with html markup and content. That page has a file name usually ending in .htm or html. It could be a server-side scripting extension, i.e. php, asp, cfm, or a variety of other languages, but for the sake of this conversation lets say we are talking about simple html.

Let’s take a look at two different URIs:

  1. http://graduateproject.dalerogers.me/
  2. http://graduateproject.dalerogers.me/report_index.htm

Both of these URIs access different pages on my graduate project web site. One item 1 above, uses a short cut method. The other, item 2, needs an entire file path.

Note: If you type in http://graduateproject.dalerogers.me, the address field will change to http://graduateproject.dalerogers.me/index.htm.

In the URI http://graduateproject.dalerogers.me/ notice there is no file name.

  • http: is the protocol.
  • //graduateproject.dalerogers.me is the server address

What file is the web server supposed to send to me once it gets my request? In the URI http://graduateproject.dalerogers.me/report_index.htm it is very clear. The web server needs find a specific file… report_index.htm. What about the first one?

The answer has more to do with file naming conventions on a particular web server. Historically, unix/linux (Apache) based web servers used index.htm as the default file name. Windows web servers (IIS) used default.htm as the default file name. This convention continues to this day. Each web server has the capacity to modify that default file name or the extensions that it is looking for, but the default naming conventions have stood the test of time.

At the time of this writing, http://graduateproject.dalerogers.me/ is a folder that has a home page named index.htm. The site is hosted on a Linux server running the Apache web server. When the the web address http://graduateproject.dalerogers.me/ is typed into the browsers address field, Apache sees there is no file name provided and looks through it internal list to see if one of the possible default names exist in the directory. If they do, it serves up that file. If not, it serves up an error message.

As designers, we can take advantage of this naming convention. Rather than having to force our visitors to remember a long filepath, we can simply give them a more meaningful URI, like www.google.com, or www.dalerogers.me, knowing that in the root directory there is a default file that the web server will provide to the audience.

A site can have an index.htm file in each subdirectory for the same reason. The designer can provide a meaningful name for each subdirectory and prevent the user from having to remember the page’s file name.

Google cloud documentation covers this nicely.