Content Type
Directives
Section titled “Directives”| Directive | Syntax |
|---|---|
AddType | AddType MIME-type extension [extension ...] |
AddEncoding | AddEncoding encoding extension [extension ...] |
AddCharset | AddCharset charset extension [extension ...] |
AddDefaultCharset | AddDefaultCharset charset|Off |
DefaultType | DefaultType MIME-type |
ForceType | ForceType MIME-type |
DirectoryIndex | DirectoryIndex filename [filename ...] |
RemoveType | RemoveType extension [extension ...] |
RemoveHandler | RemoveHandler extension [extension ...] |
Examples
Section titled “Examples”Custom MIME Types
Section titled “Custom MIME Types”AddType application/json .json5AddType application/wasm .wasmAddType font/woff2 .woff2Character Set
Section titled “Character Set”AddCharset UTF-8 .html .css .jsAddDefaultCharset UTF-8Directory Index
Section titled “Directory Index”DirectoryIndex index.php index.html index.htmForce Content Type
Section titled “Force Content Type”# Force all files in a directory to be served as plain textForceType text/plain