SREhttp/2 Manual ||
Edit MIMETYPE.CFG
Adding new extension-to-mimetype mappings
For static resources, SREhttp/2 uses the file extension to determine
what the mimetype is. The mimetype is then used
in the Content-Type response header; a response header
that most browsers use when determining how to display the resource.
SREhttp/2 has a limited set of the most common extensions hardcoded.
To expand on this set (to add new extension-to-mimetype mappings), you
can modify the MIMETYPE.CFG configuration file(s).
Notes: |
- The MIMETYPE.CFG files (like all SREhttp/2 configuration files) are
text files
- SREhttp/2 uses a default MIMETYPE.CFG file (typically located in
the SREHTTP2\CFG directory).
- SREhttp/2 also uses host-specific
versions of MIMETYPE.CFG (typically located in subdirectories under the
SREHTTP2\CFG directory) (see HOSTDATA.HTM for more
details on SREhttp/2's host-specific parameter files).
- You can use the SREhttp/2 configurator
to modify parameters in any of the MIMETYPE.CFG files.
|
---|
MIMETYPE.CFG contains entries that define these extension-to-mimetype
mappings.
Syntax:
type/subtype ext1, ext2, ...
Example:
text/plain C, FOR, PAS, ASM, BAS, JAVA
which means:
all files with extensions of .C, .FOR, .PASC, .ASM, .BAS, and .JAVA are
assumed to have a mimetype of text/plain.
Notes
-
Since MIMETYPE.CFG (like SREHTTP2.CFG and other configuration files)
can be host-specific. Thus, an extension can have different mimetypes
for different hosts.
For example,
then
- WARNING: the order of entries matters: later entries can override earlier entries.
- To use this file only when a default match can not be found, please see
the discussion of the
CHECK_MIMETYPE_FILE parameter in SREHTTP2.CFG
- You can have multiple entries with the same mimetype. For example:
text/html htm-ssi
text/html html-ssi
- Extension mapping is case insensitive. For example, htm-SSI is the
same as HTML-ssI
- Extensions can have embedded spaces (but not trailing or leading spaces)
- The case of the type/subtype is retained (its value is returned to
the client in a Content-Type response header).
- You can use the mime option, in ATTRIBS.CFG, to define mimetypes
on a selector specific basis.
- Tech Note: the list of hard coded mimetypes is contained in the MEDIATYP.SRF
(which is used to create the SREHTTP2.RXL macrospace library)
Updated on 27 September 2002