Полезная информация

Webmaster in a Nutshell

Previous Chapter 26
WebSite Server Configuration
Next
 

26.5 Directory Listings

Automatic directory index listings in WebSite are configured on the Dir Listing page of Server Admin. The Default settings for the page are shown in

[Graphic: Figure 26-5]

WebSite provides two types of directory indexing. Simple indexing will list all of the files in a directory as a bulleted list with filenames as links. Extended format is the default, and provides icons, file descriptions, modification times and dates, and header and footer files. These options are configurable as well.

If you wish, you can disable all directory indexes. If you want to restrict access to specific directory indexes, you use the Access Control page of Server Admin. The features of the Dir Listing page are described in the following sections.

The Features area of the page provides general setup options for directory listings.

Enable directory listings

This box controls directory listings for your server. It is checked by default. You can turn off listings on a URL basis on the Access Control page of Server Admin.

Extended format

This option controls which type of index format you desire. It is checked by default. If it is not checked, simple format indexes will be used, and all options on the page are unavailable except the Default document box and the Ignore Patterns listing.

Icons are links

Icons in directory listings are enabled as links to the files. The icons used for links are borderless.

Description from HTML

When this option is enabled, the contents of the <title> ... </title> tags for each file are used as the file description. The HTML title tags must occur in the first 250 bytes of the file, and the title tags must be uppercase. Annotations defined in a description file take precedence over HTML titles used as file descriptions.

Show content types

This option enables content types to be used for the file description. Description file annotations and HTML titles take precedence over content types for file descriptions.

Use HTML3 tables

With this option selected, WebSite serves extended format directory listings as HTML3 style tables (i.e., tables as supported by the Netscape browser). This option provides nicer formatting for the listing; for example, a long file description is displayed as a multi-line block of text rather than a single long line. Table listings can be selected or deselected via the URL. By appending /?table to the end of the URL, the table format will be sent by WebSite. Appending /?plain returns a non-table listing.

The Special Documents area of the Dir Listing page identifies special files used to enhance extended directory listings.

Default

This field indicates the name of the file that will be returned for any URL that does not contain an exact filename. The default value is index.*, which will make WebSite look for index with any extension. If a file using this name does not exist in the requested directory, a listing of the directory will be returned (or an error if indexing is disabled).

Header

This field specifies a filename that contains a partial HTML file (or plain text file) to include at the top of a directory listing. The default is #header, and the server will look for this name followed by either .html, .htm, or .txt. You do not have to supply an extension. An HTML header file should contain all appropriate tagging except closing </body> and </html> tags.

Footer

This field specifies a filename that contains a partial HTML file (or plain text file) to include at the bottom of a directory listing. You should not use any starting tags such as those used in the header file. Additionally, do not use the closing tags </body> or </html> as the server will supply them.

File Desc.

This field is used to specify the name of a file that contains annotations for files in the directory to be used in the file description field of a directory listing. These descriptions require a special format in the file:

[filename]|[comment or hypertext link]

Lines that begin with whitespace in the file are considered comments. You can list descriptions for some or all of the files in the directory. You can also specify an annotation for the parent directory (..). The server reads this file as HTML, so you should use the HTML coding for special characters such as ampersand (&amp;).

The Ignore Patterns section of the Dir Listing page specifies full or partial filenames that you want to exclude from all directory listings. You can use the wildcard characters ? and * here for pattern matching. The default patterns are:

#*
*.bak
~*
*.ctr

Notice that the # pattern hides all files that begin with the hash character, such as the default filenames for the header and footer files. You should hide any file types that you don't want to provide a link to, such as .exe executables. Keep in mind that the patterns you set apply to all directory listings available from your site.

To add a new pattern, type it into the edit field and press Add. To remove a pattern, select it from the list and press Delete.

The Special Icons section of the Dir Listing page specifies icon images to be used with file listings that don't have an associated content type. The other directory icons are mapped from the Mapping page according to file type or subtype. The default filenames shown exist in the /icons/ URL directory of WebSite. If you add a new icon file, you must put it there.

Unkn. Type

This specifies the icon used for files whose type is undefined. The default is a blank page image.

Parent Dir.

This specifies the icon used for the parent directory (..) listing. The default is an up arrow.

Sub Dir.

This specifies the icon used for a listing of a subdirectory of the correct directory. The default is a folder image.

Spacer

This specifies the icon used as a blank placeholder in the header of a directory listing. This icon fills the space to the left of "Name" in the header row, aligning it with the filenames below.


Previous Home Next
Virtual Servers Book Index Logging

HTML: The Definitive Guide CGI Programming JavaScript: The Definitive Guide Programming Perl WebMaster in a Nutshell