What is a Default Page?

Click here for audio version of this page

Click for Exercise at the bottom of this page

Every web server comes with its own list of default page names. Web servers also allow the administrator to change or add to that list of default page names.

Default Pages

a.k.a. Home Page, Front Page, First page, Starting page Index page and so forth

Question: What does the web server do when a visitor requests the web site but doesn't include a specific file name on the web site? Such as asking for www.mysite.com rather than www.mysite.com/todaysnews.htm.

Follow this thinking. You are a web server. What do you do?

Well there are a number of ways to handle this problem.

    1. Send a list of all the files in the top folder of the site to the visitor so that the visitor can click on various file names (this is called browsing) - like a file-manager list but as links
    2. Tell the visitor they are not allowed to look at any and all files without logging in or supplying a specific file name. If not, they are "un-authorized"
    3. Have the administrators set up each website with a specific file, as designated by the website owner, to send to visitors.
    4. Have the webserver programmers and the webserver administrators create a list of specific file names - approved filenames - which may be used by the webserver to send to the visitor. The webserver owners will inform the website owner of the approved filenames and the website owner must use only one of those approved names.

In practice all of these methods get used but for almost all purposes the last method is used to ensure standard, easy-to-know, names are used on any website.

In the early days of the web it was common to reach a website and have the entire contents of the site displayed as a list of filenames. This was called "browsing" and was quickly considered undesirable for a couple of reasons.

To some extent you don't want all your files showing anyway but the main reason is that you have no control over the way a visitor sees your site and also, your visitor, hasn't a clue what your site is about or which pages have relevance to what he or she was looking for.

While you do still see some browsing in some folders, for the most part this has been shut down and you are liable to get an error page if there is no default file.

The default file itself is simply the first file which the webserver can find in your site's top folder by running through its list of approved filenames. There are a number of possible names (not just "default."something or other). They are from the original set of names first used as home pages. So you can expect not only "default.asp" and "default.htm" but also "home.html" and "Index.html" and "Welcome.html" as well as any added arbitrarily by the administrator.

The list of page names is not written in stone. Both the names and the order of the names is changeable by any webserver administrator (your ISP - Internet service provider). Further, you can add your own, non-standard name should you wish. (That is the third bullet-point possible solution). A special name is not very common simply because it makes moving the site to another ISP a tad more difficult.

You might note that the name "Index.html" is derived from the idea that the default (home) page of a website is also a handy place to put an index of links to other pages on the site. This is one of the main purposes of the first page on a site. It also gives you a place to tell the visitor why they would want to click on any link (such as contact information) rather than making them guess from a list of the files on the drive.

The default page concept is basic to the operation of any website. It means you have to have a dependable means of sending something back to your visitors so that they can "see" your site and find out what a terrific site it is - of course.


The dialog window for IIS which controls the default file name settings

A selection of standard default names used on various servers includes:

home.html
home.htm
index.html
index.htm
welcome.html
default.htm
default.asp
default.php

The dialog above is a screen capture of the IIS (Microsoft's Internet Information Server) properties dialog, the document tab. The two default files already assigned when IIS comes to the customer are "default.htm" and "default.asp." As you might guess from looking at the "Add" and "Remove" button in the illustration above, the network administrator can add, remove or change default names, as desired.

Also, note that some pages have a three-letter file extension and some have a four-letter file extension (Such as .htm and .html). Before Windows NT and Windows 95 (in 1995) filenames in MS-DOS were limited to 8-characters for the name and 3-characters for the extension while other systems, such as UNIX could use more characters. So, on DOS and Windows systems extensions such as HTML became shortened to HTM. Either is perfectly legal, just remember, when you make a link or type a file name, computers still need the exact spelling for a page to be able to get the page.

So, very quickly:

A default page is simply the page in any website folder which the server feeds to you when you ask for a folder/or/site without specifiying a particular page name.

So, What you need to know for the assignment

You don't really have to figure out a system. That was already done years ago. But, to understand it, it helps to ask yourself how you would go about it, as we did above. At this point you are ready to use the system as set up back in the mid 1990s.

If you have a page on your site which has one of the names your server uses as a default name, then that is the page which will be shown first to a visitor to your site.

If you have more than one file in the top folder with a default file name, only the first such file on the list of default file names will ever be shown to the visitor. Here is where most of you get confused. A common mistake is to make your edits in a file called "default.htm" but not be able to see it because you also have a file called "default.asp" which is the only file the webserver keeps showing you and your visitors.

If you have both a "Default.htm" and a "Default.asp" file - only the first-listed file in the official approved-name list will be shown. In this case, because "default.asp" is the first default filename on the list this is the only file, of the two, you will see.

Poor old "default.htm" just gets ignored. So, to make sure your desired default file (such as "default.htm") is being seen, you need to get the "default.asp" file out of the way so that the web server will reach "default.htm" and send that file back to the visitor.

You can do this by deleting or renaming the "default.asp" file. Usually, in "code land," "old coders" (like me) prefer to keep things around in case we mess up and have to back track. So, just as an exercise in best practices, instead of deleting the "default.asp" file, change teh name by changing or adding some letter to the filename of "default.asp" - The webserver will pass it over in favor of "default.htm."


Exercise: Make Your Default Page

1 - Create your page

2 - On your local computer create a text file named: Default.htm

3 - Open Default.htm in Notepad.

4 - Copy the code in the table (below) for your web page and paste it into Default.htm.

5 - Replace the word "Mike's" with your own first name each time it is used.

6 - Save the file

NOTE: Do not type the code below into a WYSIWYG HTML editor such as Dreamweaver. It won't work. The code below is for use in a text editor such as Notepad.

<html>
<head>
<title>Mike's Web Site</title>
</head>

<body>
<h1>Mike's Web Site</h1>
<hr noshade>

<p><a href="bio.htm">My Bio </a></p>

<p><a href="links.htm">Links Page</a></p>



</body>
</html>

In the above code there are two links to pages we have not yet created. For now, just go ahead and copy the code from the table above, then paste it into your Default.htm file. Then view Default.htm in your browser by clicking on the file name.

7 - Fill out the code with a lot more from the template

<html>
<head>
<title>Your Name's Home Page</title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#FFFFFF">
<blockquote>

<h2>Your Names 's World Wide Web Site</h2>

<table border='0' cellpadding='2' cellspacing='0' bgcolor='#999999' width='97%' align='center'>
<tr>
<td>
<a href="Default.htm">Home</a> |
<a href="bio.htm">Bio</a> |
<a href="products.asp">Products</a> |
<a href="Articles.htm">Blog</a> |
<a href="Pictures.htm">Pictures</a> |
<a href="links.htm">Links</a> |
<a href="contact.htm">Contact</a>
</td>
<td>
<a href="Assignments310P.shtm">Assignments:310P</a>
</td>
</tr>
</table>

<table width="97%" border="0" align="center" cellpadding="5" cellspacing="0">

<!-- Start Of Row -->
<tr valign="top">

<!-- Start of Left Column in this row-->

<td>
<h4><font color="#ff0000">Left Side Column </font></h4>
<p>Text for the left-hand column </p>
</td>

<!-- Start of Center Column in this row -->


<td>
<p align="center"><img src="Images/TwoStp2_0743aC_p.jpg" width="370" height="336" border="1"><br><font size='1'>Kansas City Two Steppin' on the Vine at the Jazz Museum</font></p>
<h4><font color="#ff0000">Center Column </font></h4>
<p>Text for the center column </p>
</td>

<!-- Start of Right Column in this row -->


<td>
<h4><font color="#ff0000">Right Side Column </font></h4>
<p>text for the right-hand column </p>
</td>

</tr>

<!-- End Of Row -->

<tr valign="top">
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>

<div Style="text-align:center; font-size:10px; background-color:#999999;">
<a href="Default.htm">Home</a> |
<a href="bio.htm">Bio</a> |
<a href="products.asp">Products</a> |
<a href="Articles.htm">Blog</a> |
<a href="Pictures.htm">Pictures</a> |
<a href="links.htm">Links</a> |
<a href="contact.htm">Contact</a>
</div>

</blockquote>
</body>
</html>

The above code is a more complete page which gives you a lot of control over where items are on a page and over how the text looks. This is derived from the template page. To understand this code better go to the template page.

8 - If you already know how to do FTP, upload this file to your website using the FTP program. After uploading the file you will need to delete any "Default.asp" program on the remote compter which was created by the system admin. Right click on the remote file and choose the "delete" option. Otherwise the "Default.asp" file will be used first, instead of your "Default.htm" file (on IIS serverse the default.ASP files have precedence over default.HTM files)..


Integrating these assignments with other UMKC website classes

Special Notes - Living with other sites or code

Default File names: such as: Default.htm, Index.htm, Index.html

Here is a list of common default page names and the order in which the IIS web server at UMKC checks for them in the folder. Remember, the server serves up the first file it finds with a matching name, and stops at that point. Anything further down the list is ignored.

  1. Default.asp
  2. Default.htm
  3. Index.htm
  4. Index.html
The Existing Default.asp file

When you enrolled in the system administrators ran a script which created your website folder and a very rudimentary page, default.asp, which just lists the username for that folder. This file will get in the way of your "default.htm" file because it is on the server's list of default file names (see above), ahead of "default.htm" so you must either:
1) delete the "default.asp" file or
2) add a link on it to your "default.htm" file (especially if your are using the page for something else) or
3) add a redirection to default.htm such as: <% Response.Redirect "default.htm" %>
4) if you have frame pages now, you need to add a link in the left side, to default.htm in the right side

An Existing Index.htm or Index.html file

If you have an existing set of pages starting with either Index.htm or Index.html then you will have to find a way to route your pages around this course's Default.htm file. One way is to create a one-line Default.Asp file with a redirection command so that the server will serve default.asp before it has a chance to get down to default.htm and when it sees the re-direction command it will "leap over" default.htm.

The redirection will be <% Response.Redirect "Index.htm" %> or <% Response.Redirect "Index.html" %>

If your particular folder doesn't include Default.htm in the default file list

If you've deleted default.asp and you get an error message saying that you cannot view the site, there is something wrong with the way your site is configured. It should be showing the default.htm file you added.

Apparently, for this particular folder, the default file list does not include the name "default.htm" because you can get to it by typing in 'default.htm", but you get a "no browsing permissions" error message with the URL: http://x.web.umkc.edu/exampl    (folder only, no path and filename).

There is a workaround. Make another "Default.asp" file with a single line in it

<% Response.Redirect("Default.htm") %>

That way the server will serve up the default.asp file which in turn will redirect the server immediately to your starting file.

The <% and %> tell the server that ASP programming code lies between them.

You can also use the Server transfer method, which has certain advantages for replaced pages which also need to see incoming form elements or query strings. For now, note this, but use the redirect method.
<% Server.Transfer("Default.htm", True) %>


All answers come from this page.

Quiz: fill in the blanks

A page is simply the page in any website folder which the server feeds to you when you ask for a folder/or/site without specifiying a particular page name

It used to be common for a server to show a listing of all the files in the site with links for each one. That is called .

Lacking a specific file request, the server has to look for a filename in the folder.

A list of standard file names used on various servers includes: home.html, home.htm, index.html, index.htm, welcome.html, default.htm, default.asp, and default.php

The server doesn't magically know which page should be served to visitors to your site so each web server has a of file names which are to be sent to the visitor when a specific file name is not specified.

If you already have an existing website on UMKC then you need to:
Add a page
make new site
Add a link

Check all which are typical default-page filenames:
default.asp
homey.html
index.html
home.html
default.htm
MyComputer.htm