1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 5 6<html xmlns="http://www.w3.org/1999/xhtml"> 7 <head> 8 <meta name="generator" content="HTML Tidy, see www.w3.org" /> 9 10 <title>Apache module mod_mime</title> 11 </head> 12 <!-- Background white, links blue (unvisited), navy (visited), red (active) --> 13 14 <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" 15 vlink="#000080" alink="#FF0000"> 16 <div align="CENTER"> 17 <img src="../images/sub.gif" alt="[APACHE DOCUMENTATION]" /> 18 19 <h3>Apache HTTP Server Version 1.3</h3> 20 </div> 21 22 23 <h1 align="center">Module mod_mime</h1> 24 25 <p>This module provides for determining the types of files from 26 the filename and for association of handlers with files.</p> 27 28 <p><a href="module-dict.html#Status" 29 rel="Help"><strong>Status:</strong></a> Base<br /> 30 <a href="module-dict.html#SourceFile" 31 rel="Help"><strong>Source File:</strong></a> mod_mime.c<br /> 32 <a href="module-dict.html#ModuleIdentifier" 33 rel="Help"><strong>Module Identifier:</strong></a> 34 mime_module</p> 35 36 <h2>Summary</h2> 37 This module is used to determine various bits of "meta 38 information" about documents. This information relates to the 39 content of the document and is returned to the browser or used 40 in content-negotiation within the server. In addition, a 41 "handler" can be set for a document, which determines how the 42 document will be processed within the server. 43 44 <p>The directives <a href="#addcharset">AddCharset</a>, <a 45 href="#addencoding">AddEncoding</a>, <a 46 href="#addhandler">AddHandler</a>, <a 47 href="#addlanguage">AddLanguage</a> and <a 48 href="#addtype">AddType</a> are all used to map file extensions 49 onto the meta-information for that file. Respectively they set 50 the character set, content-encoding, handler, content-language, 51 and MIME-type (content-type) of documents. The directive <a 52 href="#typesconfig">TypesConfig</a> is used to specify a file 53 which also maps extensions onto MIME types. The directives <a 54 href="#forcetype">ForceType</a> and <a 55 href="#sethandler">SetHandler</a> are used to associated all 56 the files in a given location (<em>e.g.</em>, a particular 57 directory) onto a particular MIME type or handler.</p> 58 59 <p>Note that changing the type or encoding of a file does not 60 change the value of the <code>Last-Modified</code> header. 61 Thus, previously cached copies may still be used by a client or 62 proxy, with the previous headers.</p> 63 64 <h2>Directives</h2> 65 66 <ul> 67 <li><a href="#addcharset">AddCharset</a></li> 68 69 <li><a href="#addencoding">AddEncoding</a></li> 70 71 <li><a href="#addhandler">AddHandler</a></li> 72 73 <li><a href="#addlanguage">AddLanguage</a></li> 74 75 <li><a href="#addtype">AddType</a></li> 76 77 <li><a href="#defaultlanguage">DefaultLanguage</a></li> 78 79 <li><a href="#forcetype">ForceType</a></li> 80 81 <li><a href="#removeencoding">RemoveEncoding</a></li> 82 83 <li><a href="#removehandler">RemoveHandler</a></li> 84 85 <li><a href="#removetype">RemoveType</a></li> 86 87 <li><a href="#sethandler">SetHandler</a></li> 88 89 <li><a href="#typesconfig">TypesConfig</a></li> 90 </ul> 91 92 <p>See also: <a 93 href="mod_mime_magic.html#mimemagicfile">MimeMagicFile</a>.</p> 94 95 <h2><a id="multipleext" name="multipleext">Files with Multiple 96 Extensions</a></h2> 97 <p>Files can have more than one extension, and the order of the 98 extensions is <em>normally</em> irrelevant. For example, if the 99 file <code>welcome.html.fr</code> maps onto content type 100 <code>text/html</code> and language French then the file 101 <code>welcome.fr.html</code> will map onto exactly the same information. 102 If more than one extension is given which maps onto the same 103 type of meta-information, then the one to the right will be 104 used, except for languages and content encodings. For example, if 105 <code>.gif</code> maps to the MIME-type <code>image/gif</code> and 106 <code>.html</code> maps to the MIME-type <code>text/html</code>, then the 107 file <code>welcome.gif.html</code> will be associated with the MIME-type 108 <code>text/html</code>.</p> 109 110 <p>Languages and content encodings are treated accumulative, because one 111 can assign more than one language or encoding to a particular resource. 112 For example, the file <code>welcome.html.en.de</code> will be delivered 113 with <code>Content-Language: en, de</code> and <code>Content-Type: 114 text/html</code>.</p> 115 116 <p>Care should be taken when a file with multiple extensions 117 gets associated with both a MIME-type and a handler. This will 118 usually result in the request being by the module associated 119 with the handler. For example, if the <code>.imap</code> 120 extension is mapped to the handler "imap-file" (from mod_imap) 121 and the <code>.html</code> extension is mapped to the MIME-type 122 "text/html", then the file <code>world.imap.html</code> will be 123 associated with both the "imap-file" handler and "text/html" 124 MIME-type. When it is processed, the "imap-file" handler will 125 be used, and so it will be treated as a mod_imap imagemap 126 file.</p> 127 <hr /> 128 129 <h2><a id="addcharset" name="addcharset">AddCharset</a> 130 directive</h2> 131 <a href="directive-dict.html#Syntax" 132 rel="Help"><strong>Syntax:</strong></a> AddCharset <em>charset 133 extension</em> [<em>extension</em>] ...<br /> 134 <a href="directive-dict.html#Context" 135 rel="Help"><strong>Context:</strong></a> server config, virtual 136 host, directory, .htaccess<br /> 137 <a href="directive-dict.html#Override" 138 rel="Help"><strong>Override:</strong></a> FileInfo<br /> 139 <a href="directive-dict.html#Status" 140 rel="Help"><strong>Status:</strong></a> Base<br /> 141 <a href="directive-dict.html#Module" 142 rel="Help"><strong>Module:</strong></a> mod_mime <br /> 143 <a href="directive-dict.html#Compatibility" 144 rel="Help"><strong>Compatibility:</strong></a> AddCharset is 145 only available in Apache 1.3.10 and later 146 147 <p>The AddCharset directive maps the given filename extensions 148 to the specified content charset. <i>charset</i> is the MIME 149 charset parameter of filenames containing <i>extension</i>. 150 This mapping is added to any already in force, overriding any 151 mappings that already exist for the same <i>extension</i>.</p> 152 153 <p>Example:</p> 154<pre> 155 AddLanguage ja .ja 156 AddCharset EUC-JP .euc 157 AddCharset ISO-2022-JP .jis 158 AddCharset SHIFT_JIS .sjis 159</pre> 160 161 <p>Then the document <code>xxxx.ja.jis</code> will be treated 162 as being a Japanese document whose charset is ISO-2022-JP (as 163 will the document <code>xxxx.jis.ja</code>). The AddCharset 164 directive is useful for both to inform the client about the 165 character encoding of the document so that the document can be 166 interpreted and displayed appropriately, and for <a 167 href="../content-negotiation.html">content negotiation</a>, 168 where the server returns one from several documents based on 169 the client's charset preference.</p> 170 171 <p>The <em>extension</em> argument is case-insensitive, and can 172 be specified with or without a leading dot.</p> 173 174 <p><strong>See also</strong>: <a 175 href="mod_negotiation.html">mod_negotiation</a></p> 176 <hr /> 177 178 <h2><a id="addencoding" name="addencoding">AddEncoding</a> 179 directive</h2> 180 <!--%plaintext <?INDEX {\tt AddEncoding} directive> --> 181 <a href="directive-dict.html#Syntax" 182 rel="Help"><strong>Syntax:</strong></a> AddEncoding 183 <em>MIME-enc extension</em> [<em>extension</em>] ...<br /> 184 <a href="directive-dict.html#Context" 185 rel="Help"><strong>Context:</strong></a> server config, virtual 186 host, directory, .htaccess<br /> 187 <a href="directive-dict.html#Override" 188 rel="Help"><strong>Override:</strong></a> FileInfo<br /> 189 <a href="directive-dict.html#Status" 190 rel="Help"><strong>Status:</strong></a> Base<br /> 191 <a href="directive-dict.html#Module" 192 rel="Help"><strong>Module:</strong></a> mod_mime 193 194 <p>The AddEncoding directive maps the given filename extensions 195 to the specified encoding type. <em>MIME-enc</em> is the MIME 196 encoding to use for documents containing the 197 <em>extension</em>. This mapping is added to any already in 198 force, overriding any mappings that already exist for the same 199 <em>extension</em>. Example:</p> 200 201 <blockquote> 202 <code>AddEncoding x-gzip .gz<br /> 203 AddEncoding x-compress .Z</code> 204 </blockquote> 205 This will cause filenames containing the .gz extension to be 206 marked as encoded using the x-gzip encoding, and filenames 207 containing the .Z extension to be marked as encoded with 208 x-compress. 209 210 <p>Old clients expect <code>x-gzip</code> and 211 <code>x-compress</code>, however the standard dictates that 212 they're equivalent to <code>gzip</code> and 213 <code>compress</code> respectively. Apache does content 214 encoding comparisons by ignoring any leading <code>x-</code>. 215 When responding with an encoding Apache will use whatever form 216 (<em>i.e.</em>, <code>x-foo</code> or <code>foo</code>) the 217 client requested. If the client didn't specifically request a 218 particular form Apache will use the form given by the 219 <code>AddEncoding</code> directive. To make this long story 220 short, you should always use <code>x-gzip</code> and 221 <code>x-compress</code> for these two specific encodings. More 222 recent encodings, such as <code>deflate</code> should be 223 specified without the <code>x-</code>.</p> 224 225 <p>The <em>extension</em> argument is case-insensitive, and can 226 be specified with or without a leading dot.</p> 227 228 <p><strong>See also</strong>: <a href="#multipleext">Files with 229 multiple extensions</a></p> 230 <hr /> 231 232 <h2><a id="addhandler" name="addhandler">AddHandler</a> 233 directive</h2> 234 <a href="directive-dict.html#Syntax" 235 rel="Help"><strong>Syntax:</strong></a> AddHandler 236 <em>handler-name extension</em> [<em>extension</em>] ...<br /> 237 <a href="directive-dict.html#Context" 238 rel="Help"><strong>Context:</strong></a> server config, virtual 239 host, directory, .htaccess<br /> 240 <a href="directive-dict.html#Override" 241 rel="Help"><strong>Override:</strong></a> FileInfo<br /> 242 <a href="directive-dict.html#Status" 243 rel="Help"><strong>Status:</strong></a> Base<br /> 244 <a href="directive-dict.html#Module" 245 rel="Help"><strong>Module:</strong></a> mod_mime<br /> 246 <a href="directive-dict.html#Compatibility" 247 rel="Help"><strong>Compatibility:</strong></a> AddHandler is 248 only available in Apache 1.1 and later 249 250 <p>AddHandler maps the filename extensions <em>extension</em> 251 to the <a href="../handler.html">handler</a> 252 <em>handler-name</em>. This mapping is added to any already in 253 force, overriding any mappings that already exist for the same 254 <em>extension</em>. For example, to activate CGI scripts with 255 the file extension "<code>.cgi</code>", you might use:</p> 256<pre> 257 AddHandler cgi-script .cgi 258</pre> 259 260 <p>Once that has been put into your srm.conf or httpd.conf 261 file, any file containing the "<code>.cgi</code>" extension 262 will be treated as a CGI program.</p> 263 264 <p>The <em>extension</em> argument is case-insensitive, and can 265 be specified with or without a leading dot.</p> 266 267 <p><strong>See also</strong>: <a href="#multipleext">Files with 268 multiple extensions</a>, <a href="#sethandler">SetHandler</a></p> 269 <hr /> 270 271 <h2><a id="addlanguage" name="addlanguage">AddLanguage</a> 272 directive</h2> 273 <!--%plaintext <?INDEX {\tt AddLanguage} directive> --> 274 <a href="directive-dict.html#Syntax" 275 rel="Help"><strong>Syntax:</strong></a> AddLanguage 276 <em>MIME-lang extension</em> [<em>extension</em>] ...<br /> 277 <a href="directive-dict.html#Context" 278 rel="Help"><strong>Context:</strong></a> server config, virtual 279 host, directory, .htaccess<br /> 280 <a href="directive-dict.html#Override" 281 rel="Help"><strong>Override:</strong></a> FileInfo<br /> 282 <a href="directive-dict.html#Status" 283 rel="Help"><strong>Status:</strong></a> Base<br /> 284 <a href="directive-dict.html#Module" 285 rel="Help"><strong>Module:</strong></a> mod_mime 286 287 <p>The AddLanguage directive maps the given filename extension 288 to the specified content language. <em>MIME-lang</em> is the 289 MIME language of filenames containing <em>extension</em>. This 290 mapping is added to any already in force, overriding any 291 mappings that already exist for the same 292 <em>extension</em>.</p> 293 294 <p>Example:</p> 295 296 <blockquote> 297 <code>AddEncoding x-compress .Z<br /> 298 AddLanguage en .en<br /> 299 AddLanguage fr .fr<br /> 300 </code> 301 </blockquote> 302 303 <p>Then the document <code>xxxx.en.Z</code> will be treated as 304 being a compressed English document (as will the document 305 <code>xxxx.Z.en</code>). Although the content language is 306 reported to the client, the browser is unlikely to use this 307 information. The AddLanguage directive is more useful for <a 308 href="../content-negotiation.html">content negotiation</a>, 309 where the server returns one from several documents based on 310 the client's language preference.</p> 311 312 <p>If multiple language assignments are made for the same 313 extension, the last one encountered is the one that is used. 314 That is, for the case of:</p> 315<pre> 316 AddLanguage en .en 317 AddLanguage en-gb .en 318 AddLanguage en-us .en 319</pre> 320 321 <p>documents with the extension "<code>.en</code>" would be 322 treated as being "<code>en-us</code>".</p> 323 324 <p>The <em>extension</em> argument is case-insensitive, and can 325 be specified with or without a leading dot.</p> 326 327 <p><strong>See also</strong>: <a href="#multipleext">Files with 328 multiple extensions</a>, <a 329 href="#defaultlanguage">DefaultLanguage</a><br /> 330 <strong>See also</strong>: <a 331 href="./mod_negotiation.html">mod_negotiation</a></p> 332 <hr /> 333 334 <h2><a id="addtype" name="addtype">AddType</a> directive</h2> 335 <!--%plaintext <?INDEX {\tt AddType} directive> --> 336 <a href="directive-dict.html#Syntax" 337 rel="Help"><strong>Syntax:</strong></a> AddType <em>MIME-type 338 extension</em> [<em>extension</em>] ...<br /> 339 <a href="directive-dict.html#Context" 340 rel="Help"><strong>Context:</strong></a> server config, virtual 341 host, directory, .htaccess<br /> 342 <a href="directive-dict.html#Override" 343 rel="Help"><strong>Override:</strong></a> FileInfo<br /> 344 <a href="directive-dict.html#Status" 345 rel="Help"><strong>Status:</strong></a> Base<br /> 346 <a href="directive-dict.html#Module" 347 rel="Help"><strong>Module:</strong></a> mod_mime 348 349 <p>The AddType directive maps the given filename extensions 350 onto the specified content type. <em>MIME-type</em> is the MIME 351 type to use for filenames containing <em>extension</em>. This 352 mapping is added to any already in force, overriding any 353 mappings that already exist for the same <em>extension</em>. 354 This directive can be used to add mappings not listed in the 355 MIME types file (see the <code><a 356 href="#typesconfig">TypesConfig</a></code> directive). 357 Example:</p> 358 359 <blockquote> 360 <code>AddType image/gif .gif</code> 361 </blockquote> 362 It is recommended that new MIME types be added using the 363 AddType directive rather than changing the <a 364 href="#typesconfig">TypesConfig</a> file. 365 366 <p>Note that, unlike the NCSA httpd, this directive cannot be 367 used to set the type of particular files.</p> 368 369 <p>The <em>extension</em> argument is case-insensitive, and can 370 be specified with or without a leading dot.</p> 371 372 <p><strong>See also</strong>: <a href="#multipleext">Files with 373 multiple extensions</a></p> 374 <hr /> 375 376 <h2><a id="defaultlanguage" 377 name="defaultlanguage">DefaultLanguage</a> directive</h2> 378 <!--%plaintext <?INDEX {\tt DefaultLanguage} directive> --> 379 <a href="directive-dict.html#Syntax" 380 rel="Help"><strong>Syntax:</strong></a> DefaultLanguage 381 <em>MIME-lang</em><br /> 382 <a href="directive-dict.html#Context" 383 rel="Help"><strong>Context:</strong></a> server config, virtual 384 host, directory, .htaccess<br /> 385 <a href="directive-dict.html#Override" 386 rel="Help"><strong>Override:</strong></a> FileInfo<br /> 387 <a href="directive-dict.html#Status" 388 rel="Help"><strong>Status:</strong></a> Base<br /> 389 <a href="directive-dict.html#Module" 390 rel="Help"><strong>Module:</strong></a> mod_mime<br /> 391 <a href="directive-dict.html#Compatibility" 392 rel="Help"><strong>Compatibility:</strong></a> DefaultLanguage 393 is only available in Apache 1.3.4 and later. 394 395 <p>The DefaultLanguage directive tells Apache that all files in 396 the directive's scope (<em>e.g.</em>, all files covered by the 397 current <code><Directory></code> container) that don't 398 have an explicit language extension (such as <samp>.fr</samp> 399 or <samp>.de</samp> as configured by <samp>AddLanguage</samp>) 400 should be considered to be in the specified <em>MIME-lang</em> 401 language. This allows entire directories to be marked as 402 containing Dutch content, for instance, without having to 403 rename each file. Note that unlike using extensions to specify 404 languages, <samp>DefaultLanguage</samp> can only specify a 405 single language.</p> 406 407 <p>For example:</p> 408 409 <code>DefaultLanguage fr</code> 410 411 <p>If no <samp>DefaultLanguage</samp> directive is in force, 412 and a file does not have any language extensions as configured 413 by <samp>AddLanguage</samp>, then that file will be considered 414 to have no language attribute.</p> 415 416 <p><strong>See also</strong>: <a 417 href="./mod_negotiation.html">mod_negotiation</a><br /> 418 <strong>See also</strong>: <a href="#multipleext">Files with 419 multiple extensions</a></p> 420 <hr /> 421 422 <h2><a id="forcetype" name="forcetype">ForceType</a> 423 directive</h2> 424 <a href="directive-dict.html#Syntax" 425 rel="Help"><strong>Syntax:</strong></a> ForceType 426 <em>media-type</em>|None<br /> 427 <a href="directive-dict.html#Context" 428 rel="Help"><strong>Context:</strong></a> directory, 429 .htaccess<br /> 430 <a href="directive-dict.html#Status" 431 rel="Help"><strong>Status:</strong></a> Base<br /> 432 <a href="directive-dict.html#Module" 433 rel="Help"><strong>Module:</strong></a> mod_mime<br /> 434 <a href="directive-dict.html#Compatibility" 435 rel="Help"><strong>Compatibility:</strong></a> ForceType is 436 only available in Apache 1.1 and later. 437 438 <p>When placed into an <code>.htaccess</code> file or a 439 <code><Directory></code> or <code><Location></code> 440 section, this directive forces all matching files to be served 441 as the content type given by <em>media type</em>. For example, 442 if you had a directory full of GIF files, but did not want to 443 label them all with ".gif", you might want to use:</p> 444<pre> 445 ForceType image/gif 446</pre> 447 448 <p>Note that this will override any filename extensions that 449 might determine the media type.</p> 450 451 <p>You can override any <directive>ForceType</directive> setting 452 by using the value of <code>none</code>:</p> 453 454<pre> 455 # force all files to be image/gif: 456 <Location /images> 457 ForceType image/gif 458 </Location> 459 460 # but normal mime-type associations here: 461 <Location /images/mixed> 462 ForceType none 463 </Location> 464</pre> 465 466 <p><strong>See also</strong>: <a 467 href="#addtype">AddType</a></p> 468 469 <hr /> 470 471 <h2><a id="removeencoding" 472 name="removeencoding">RemoveEncoding</a> directive</h2> 473 <a href="directive-dict.html#Syntax" 474 rel="Help"><strong>Syntax:</strong></a> RemoveEncoding 475 <em>extension</em> [<em>extension</em>] ...<br /> 476 <a href="directive-dict.html#Context" 477 rel="Help"><strong>Context:</strong></a> virtual host, directory, 478 .htaccess<br /> 479 <a href="directive-dict.html#Status" 480 rel="Help"><strong>Status:</strong></a> Base<br /> 481 <a href="directive-dict.html#Module" 482 rel="Help"><strong>Module:</strong></a> mod_mime<br /> 483 <a href="directive-dict.html#Compatibility" 484 rel="Help"><strong>Compatibility:</strong></a> RemoveEncoding 485 is only available in Apache 1.3.13 and later. 486 487 <p>The <samp>RemoveEncoding</samp> directive removes any 488 encoding associations for files with the given extensions. This 489 allows <code>.htaccess</code> files in subdirectories to undo 490 any associations inherited from parent directories or the 491 server config files. An example of its use might be:</p> 492 493 <dl> 494 <dt><code>/foo/.htaccess:</code></dt> 495 496 <dd><code>AddEncoding x-gzip .gz</code><br /> 497 <code>AddType text/plain .asc</code><br /> 498 <code><Files *.gz.asc></code><br /> 499 <code> RemoveEncoding 500 .gz</code><br /> 501 <code></Files></code></dd> 502 </dl> 503 504 <p>This will cause <code>foo.gz</code> to mark as being encoded 505 with the gzip method, but <code>foo.gz.asc</code> as an 506 unencoded plaintext file.</p> 507 508 <p><b>Note:</b>RemoveEncoding directives are processed 509 <i>after</i> any <a href="#addencoding">AddEncoding</a> 510 directives, so it is possible they 511 may undo the effects of the latter if both occur within the 512 same directory configuration.</p> 513 514 <p>The <em>extension</em> argument is case-insensitive, and can 515 be specified with or without a leading dot.</p> 516 <hr /> 517 518 <h2><a id="removehandler" 519 name="removehandler">RemoveHandler</a> directive</h2> 520 <a href="directive-dict.html#Syntax" 521 rel="Help"><strong>Syntax:</strong></a> RemoveHandler 522 <em>extension</em> [<em>extension</em>] ...<br /> 523 <a href="directive-dict.html#Context" 524 rel="Help"><strong>Context:</strong></a> virtual host, directory, 525 .htaccess<br /> 526 <a href="directive-dict.html#Status" 527 rel="Help"><strong>Status:</strong></a> Base<br /> 528 <a href="directive-dict.html#Module" 529 rel="Help"><strong>Module:</strong></a> mod_mime<br /> 530 <a href="directive-dict.html#Compatibility" 531 rel="Help"><strong>Compatibility:</strong></a> RemoveHandler is 532 only available in Apache 1.3.4 and later. 533 534 <p>The <samp>RemoveHandler</samp> directive removes any handler 535 associations for files with the given extensions. This allows 536 <code>.htaccess</code> files in subdirectories to undo any 537 associations inherited from parent directories or the server 538 config files. An example of its use might be:</p> 539 540 <dl> 541 <dt><code>/foo/.htaccess:</code></dt> 542 543 <dd><code>AddHandler server-parsed .html</code></dd> 544 545 <dt><code>/foo/bar/.htaccess:</code></dt> 546 547 <dd><code>RemoveHandler .html</code></dd> 548 </dl> 549 550 <p>This has the effect of returning <samp>.html</samp> files in 551 the <samp>/foo/bar</samp> directory to being treated as normal 552 files, rather than as candidates for parsing (see the <a 553 href="mod_include.html"><samp>mod_include</samp></a> 554 module).</p> 555 556 <p>The <em>extension</em> argument is case-insensitive, and can 557 be specified with or without a leading dot.</p> 558 <hr /> 559 560 <h2><a id="removetype" name="removetype">RemoveType</a> 561 directive</h2> 562 <a href="directive-dict.html#Syntax" 563 rel="Help"><strong>Syntax:</strong></a> RemoveType 564 <em>extension</em> [<em>extension</em>] ...<br /> 565 <a href="directive-dict.html#Context" 566 rel="Help"><strong>Context:</strong></a> virtual host, directory, 567 .htaccess<br /> 568 <a href="directive-dict.html#Status" 569 rel="Help"><strong>Status:</strong></a> Base<br /> 570 <a href="directive-dict.html#Module" 571 rel="Help"><strong>Module:</strong></a> mod_mime<br /> 572 <a href="directive-dict.html#Compatibility" 573 rel="Help"><strong>Compatibility:</strong></a> RemoveType is 574 only available in Apache 1.3.13 and later. 575 576 <p>The <samp>RemoveType</samp> directive removes any MIME type 577 associations for files with the given extensions. This allows 578 <code>.htaccess</code> files in subdirectories to undo any 579 associations inherited from parent directories or the server 580 config files. An example of its use might be:</p> 581 582 <dl> 583 <dt><code>/foo/.htaccess:</code></dt> 584 585 <dd><code>RemoveType .cgi</code></dd> 586 </dl> 587 588 <p>This will remove any special handling of <code>.cgi</code> 589 files in the <code>/foo/</code> directory and any beneath it, 590 causing the files to be treated as being of the <a 591 href="core.html#defaulttype">default type</a>.</p> 592 593 <p><b>Note:</b><code>RemoveType</code> directives are processed 594 <i>after</i> any <code>AddType</code> directives, so it is 595 possible they may undo the effects of the latter if both occur 596 within the same directory configuration.</p> 597 598 <p>The <em>extension</em> argument is case-insensitive, and can 599 be specified with or without a leading dot.</p> 600 <hr /> 601 602 <h2><a id="sethandler" name="sethandler">SetHandler</a> 603 directive</h2> 604 <a href="directive-dict.html#Syntax" 605 rel="Help"><strong>Syntax:</strong></a> SetHandler 606 <em>handler-name</em>|None<br /> 607 <a href="directive-dict.html#Context" 608 rel="Help"><strong>Context:</strong></a> directory, 609 .htaccess<br /> 610 <a href="directive-dict.html#Status" 611 rel="Help"><strong>Status:</strong></a> Base<br /> 612 <a href="directive-dict.html#Module" 613 rel="Help"><strong>Module:</strong></a> mod_mime<br /> 614 <a href="directive-dict.html#Compatibility" 615 rel="Help"><strong>Compatibility:</strong></a> SetHandler is 616 only available in Apache 1.1 and later. 617 618 <p>When placed into an <code>.htaccess</code> file or a 619 <code><Directory></code> or <code><Location></code> 620 section, this directive forces all matching files to be parsed 621 through the <a href="../handler.html">handler</a> given by 622 <em>handler-name</em>. For example, if you had a directory you 623 wanted to be parsed entirely as imagemap rule files, regardless 624 of extension, you might put the following into an 625 <code>.htaccess</code> file in that directory:</p> 626<pre> 627 SetHandler imap-file 628</pre> 629 630 <p>Another example: if you wanted to have the server display a 631 status report whenever a URL of 632 <code>http://servername/status</code> was called, you might put 633 the following into access.conf: (See <a 634 href="mod_status.html">mod_status</a> for more details.)</p> 635<pre> 636 <Location /status> 637 SetHandler server-status 638 </Location> 639</pre> 640 641 <p>You can override an earlier defined <code>SetHandler</code> 642 directive by using the value <code>None</code>.</p> 643 644 <p><strong>See also</strong>: <a href="#addhandler">AddHandler</a></p> 645 <hr /> 646 647 <h2><a id="typesconfig" name="typesconfig">TypesConfig</a> 648 directive</h2> 649 <!--%plaintext <?INDEX {\tt TypesConfig} directive> --> 650 <a href="directive-dict.html#Syntax" 651 rel="Help"><strong>Syntax:</strong></a> TypesConfig 652 <em>file-path</em><br /> 653 <a href="directive-dict.html#Default" 654 rel="Help"><strong>Default:</strong></a> <code>TypesConfig 655 conf/mime.types</code><br /> 656 <a href="directive-dict.html#Context" 657 rel="Help"><strong>Context:</strong></a> server config<br /> 658 <a href="directive-dict.html#Status" 659 rel="Help"><strong>Status:</strong></a> Base<br /> 660 <a href="directive-dict.html#Module" 661 rel="Help"><strong>Module:</strong></a> mod_mime 662 663 <p>The TypesConfig directive sets the location of the MIME 664 types configuration file. <em>Filename</em> is relative to the 665 <a href="core.html#serverroot">ServerRoot</a>. This file sets 666 the default list of mappings from filename extensions to 667 content types; changing this file is not recommended. Use the 668 <a href="#addtype">AddType</a> directive instead. The file 669 contains lines in the format of the arguments to an AddType 670 command:</p> 671 672 <blockquote> 673 <em>MIME-type extension extension ...</em> 674 </blockquote> 675 The extensions are lower-cased. Blank lines, and lines 676 beginning with a hash character (`#') are ignored. 677 678 <p> <hr /> 679 680 <h3 align="CENTER">Apache HTTP Server Version 1.3</h3> 681 <a href="./"><img src="../images/index.gif" alt="Index" /></a> 682 <a href="../"><img src="../images/home.gif" alt="Home" /></a> 683 684 </p> 685 </body> 686</html> 687 688 689