Book HomeWebmaster in a Nutshell, 3rd EditionSearch this book

19.24. mod_mime

The mod_mime module contains directives that help to organize various MIME types on the server.

AddCharsetAddCharset character_set extensions ...

[server config, or within <VirtualHost> or <Directory>, or .htaccess]
Associates the specified filename extensions with the named MIME character set. If the extensions are already mapped to another characher set, they are remapped to this one.

AddEncoding

AddEncoding encoding extension ...

[server config, or within <VirtualHost> or <Directory>, or .htaccess]

Allows you to specify which MIME encodings should be associated with documents from your server. Encodings beginning with x- are used for unofficial encodings. For example:

AddEncoding x-gzip gz
AddHandler

AddHandler handler-name extension ...

[server config, or within <VirtualHost> or <Directory>, or .htaccess]

Maps one or more filename extensions to a specific handler for the server. For example, for CGI scripts, you might use the following:

AddHandler cgi-script cgi
AddLanguage

AddLanguage mime-lang extension ...

[server config, or within <VirtualHost> or <Directory>, or .htaccess]

Specifies that a certain extension should be associated with a specific language for purposes of content negotiation. For example, to associate the extension .francais with French documents, use the following setting:

AddLanguage fr .francais
AddType

AddType mime-type extension ...

[server config, or within <VirtualHost> or <Directory>, or .htaccess]

Specifies a MIME type and subtype to be associated with certain file extensions. For example, if you want to serve a Microsoft Word document:

AddType application/msword .doc

AddType directives overrides any extension-to-type mappings in your mime.types file.

DefaultLanguage

DefaultLanguage language

[server config, or within <VirtualHost> or <Directory>, or .htaccess]

Specifies the default language for any files that are not associated with a particular language via AddLanguage.

ForceType

ForceType mime_type

[Within <Directory>, or .htaccess]

Specifies that all files in this directory should be served with the specified type. Appropriate for inclusion in .htaccess files or within <Directory> section directives.

RemoveEncodingRemoveEncoding extensions ...

[Within <Directory>, or .htaccess]

Removes any associated encodinges for files matching the specified extensions.

RemoveHandlerRemoveHandler extensions ...

[Within <Directory>, or .htaccess]

Removes any associated handlers for files matching the specified extensions.

RemoveTypeRemoveType extensions ...

[Within <Directory>, or .htaccess]

Removes any associated MIME types for files matching the specified extensions.

SetHandler

SetHandler handler

[Within <Directory>, or .htaccess]

Specifies that all files in the directory should be passed through the specified handler. Values are:

cgi-script
All files treated as CGI scripts (see Chapter 12)

imap-file
All files treated as imagemap files

send-as-is
All files sent as is without additional server-supplied HTTP headers

server-info
All files sent with server configuration information

server-parsed
All files parsed as server-side includes (see Chapter 12)

type-map
All files parsed as type map files for content negotiation

TypesConfig

TypesConfig filename

[server config]

Specifies the location of the MIME types file. As with other configuration paths, the location may be given as either an absolute path or a relative path to the ServerRoot directory. The default is:

TypesConfig conf/mime.types


Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.