W3C httpd manual

Suffix Definitions for W3C httpd

W3C httpd uses suffixes to discover the content-type, content-encoding and content-language of a file. Default values are so extensive that httpd knows the usual file types. The following configuration directives can be used to add new suffix bindings and override existing defaults:

Binding Suffixes to MIME Content-Types

As well as any mapping lines in the rule file, the rule file may be used to define the data types of files with particular suffixes. W3C httpd has an extensive set of predefined suffixes, so usually you don't need to specify any.

The syntax is:

        AddType .suffix representation encoding [quality]
The parameters are as follows:
suffix
The last part of the filename. There are two special cases. *.* matches to all files which have not been matched by any explicit suffixes but do contain a dot. * by itself matches to any file which does not match any other suffix.

representation
A MIME Content-Type style description of the representation in fact in use in the file. See the HTTP spec. This need not be a real MIME type - it will only be used if it matches a type given by a client.

encoding
A MIME content transfer encoding type. Much more limited in variety than representations, basically whether the file is ASCII (7bit or 8bit) or binary. A few other encodings are allowed, and maybe extension to compression.

quality
Optional. A floating point number between 0.0 and 1.0 which determines the relative merits of files xxx.* which differ in their suffix only, when a link to xxx.multi is being resolved. Defaults to 1.0.

Examples

        AddType .html text/html              8bit     1.0
        AddType .text text/plain             7bit     0.9
        AddType .ps   application/postscript 8bit     1.0
        AddType *.*   application/binary     binary   0.1
        AddType *     text/plain             7bit

Historical Note (Suffix Directive)

AddType was previously called Suffix. The old name is still understood, but may be misleading since suffixes are also used to determine Content-Encoding and language. Always use AddType instead.


Binding Suffixes to MIME Content-Encodings

Suffixes are also used to determine the Content-Encoding of a file (.Z suffix for x-compressed, for example). Syntax is:
        AddEncoding .suffix  encoding

Example

        AddEncoding .Z  x-compress

Multilanguage Support

Multilanguage support is also built on using suffixes to determine the language of a document. Suffix is bound to a language by AddLanguage rule (.en suffix for English, for example). Syntax is:
        AddLanguage .suffix  encoding

Examples

        AddLanguage .en  en
        AddLanguage .uk  en_UK

Suffix Case Sensitivity

Suffix case sensitivity is by default off. You can make suffixes case sensitive with SuffixCaseSense directive:
        SuffixCaseSense On


[email protected], July 1995