less than 1 minute read

How do you add a MIME type to Apache HTTP Server?

Just add AddType type .extension1 .extension2 inside IfModule mime_module.

Here is an example:

<!-- httpd.conf -->
<IfModule mime_module>
    TypesConfig conf/mime.types

    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz

    AddType application/x-httpd-php .php .php3 .inc .ph .htm
    AddType application/x-httpd-php-source .phps
</IfModule>

20210928

Leave a comment