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.
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.
- 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
- 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"
- Have the administrators set up each website with a specific file, as designated by the website owner, to send to visitors.
- 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
- The server doesn't magically know which page should be served to visitors to your site.
- So ...
- Each server has a list of file names which are to be sent to the visitor when a specific file name is not specified.
- The first name on the list which matches a file in the folder is the page which is delivered
- Default pages are given specific names which depend on the server software.
A selection of standard default names used on various servers includes:
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."
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.
<p><a href="bio.htm">My Bio </a></p>
<p><a href="links.htm">Links Page</a></p>
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
<h2>Your Names 's World Wide Web Site</h2>
<!-- Start Of Row -->
<!-- Start of Left Column in this row-->
<!-- Start of Center Column in this row -->
<!-- Start of Right Column in this row -->
<!-- End Of Row -->
<div Style="text-align:center; font-size:10px; background-color:#999999;">
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.
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:
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).
All answers come from this page.