A MIME type tells a browser or app what kind of file it's receiving, so it knows whether to display it, play it, or download it. If visitors are being prompted to download a file instead of viewing it, a video won't stream, a custom font fails to load, or an app expecting a specific file format throws an error, your server may not recognize that file's extension. Adding or editing a MIME type fixes this.
What Is a MIME Type?
A MIME type (also called a content type) is a label like text/html or image/png that your web server attaches to a file's response so the receiving browser or app knows how to handle it. Most common file extensions (.html, .jpg, .css, .js) already have a MIME type built into your server's system-wide list. You only need to add one manually for less common or custom extensions.
When You'd Need to Add or Edit One
- A newer font format like .woff2 isn't loading on your website.
- A video or audio file downloads instead of playing in the browser.
- A .json, .webmanifest, or other data file used by an app or Progressive Web App returns the wrong content type.
- A custom file extension used by software you've installed isn't recognized by the server.
This is an advanced setting most websites never need to touch. Only add a MIME type if you've confirmed a specific file extension is the actual cause of the problem, and double-check the exact extension and type before saving.
How to Add a MIME Type
In cPanel
- Log in to cPanel and go to the Advanced section.
- Click MIME Types.
- Under Create a MIME Type, enter the type and subtype in the MIME Type field (for example, font/woff2), without a leading dot.
- In the Extension(s) field, enter the file extension without the dot (for example, woff2). You can separate multiple extensions with a space to map them to the same type.
- Click Add.
To remove a MIME type you created, find it in the list on the same page and click Delete next to it. You can only delete types you've added yourself, not the system's built-in ones.
In DirectAdmin
- Log in to DirectAdmin and look under your account's Advanced Features section for MIME Types.
- Enter the MIME type (for example, font/woff2) in the type field.
- Enter the file extension (for example, woff2) in the extension field.
- Click Add. To map more than one extension to the same type, repeat the step with a different extension.
To remove an entry, check the box next to the MIME type or extension you want to remove and click Delete.
After You Add It
Reload the page or file in your browser to confirm it now behaves correctly. If it still looks wrong, clear your browser cache first, since browsers often cache the old content type for a file it has already loaded.
If a file extension still isn't handled correctly after adding a matching MIME type, the problem may be elsewhere, such as the file itself being corrupted or a plugin or script expecting a different format. Contact support if you're not sure the MIME type is really the cause.