Applicable in ObjectType-class directives.
The type-by-extension function instructs the server to look in a table of MIME type mappings to find the MIME type of the requested resource according to the extension of the requested resource. The MIME type is added to the Content-Type header sent back to the client.
The table of MIME type mappings is created by a MIME element in the server.xml file, which loads a MIME types file or list and creates the mappings. For more information about server.xml , see Chapter 2, Server Configuration Elements in the server.xml file.
For example, the following two lines are part of a MIME types file:
type=text/html exts=htm,htmltype=text/plain exts=txt |
If the extension of the requested resource is htm or html, the type-by-extension file sets the type to text/html. If the extension is .txt, the function sets the type to text/plain.
The following table describes the parameter for the type-by-extension function.
Table 5–93 type-by-extension Parameters
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. |
ObjectType fn=type-by-extension |