How to add file extension to MIME types at Hostinger

Adding MIME types using .htaccess

Updated 2 days ago

While most of the content of your website is recognized automatically as text, images, etc., there may be some cases where you will need to specify the type of file extension via code to ensure that it works correctly.

Add a MIME type

To do it, you will need to add a line to your .htaccess file following this structure:

AddType type/subtype ext

Where type/subtype indicates the kind of document and ext the file extension associated with it. For example, for Windows Media Audio files (WMA), it would look like this:

AddType audio/x-ms-wma wma

Multiple file extensions can be associated with the same MIME type in the same line, such as this:

AddType video/mp4 mp4 m4v f4v f4p

With the correct MIME type added, browsers and servers can correctly identify and handle that file type going forward.

Additional resource