[map]A Site Structure Pattern from
Patterns for Personal Web Sites

Default Pages

When a Web server receives a request for a URL that resolves to a directory, it will return that directory's default page if one exists. If one doesn't, many servers return a listing of the directory's contents, which can expose files and directories that are not intended to be public. It also exposes the site's guts to visitors, making the site appear unfinished.

Therefore, ensure that each of your site's directories has a default page.

Default page names vary from server to server. The most common is index.html; less common names include default.html and home.html. Check with your Web server's administrator if you're unsure of its default page name.

Depending on its configuration & capabilities, your Web server may offer alternatives to putting a default page in each directory:

  1. The server may return an error message (most likely HTTP status code 403, Forbidden) if a default page isn't found.

  2. Rather than creating a default Web page as a file, the server may be able to automatically redirect visitors to another page (e.g., your site's home page, or an error page).

Last updated 8 July 2003
All contents ©2002-2003 Mark L. Irons