How to Add a Custom MIME Type in cPanel
A MIME type tells the browser what kind of file it is receiving — a web page, an image, a font, a video — so it knows whether to display it, play it, or download it. When a file behaves oddly (a font that will not load, or a file that downloads when it should open), a missing or wrong MIME type is often the reason, and cPanel lets you fix it.
When you might need this
- A custom web font (like
.woff2) fails to load. - A newer file format the server does not recognise gets served as plain text.
- A file downloads instead of opening in the browser.
Step 1: Open MIME Types
- Log in to cPanel.
- Under the Advanced section, click MIME Types.
Step 2: Add your type
- In the MIME Type field, enter the type — for example
font/woff2. - In the Extension(s) field, enter the file extension(s) it applies to, like
woff2. - Click Add.
The server now serves those files with the correct type, and browsers handle them properly.
Doing it in .htaccess instead
You can also declare MIME types in your .htaccess file with an AddType line, which keeps the setting with your site if you move it. See creating and editing your .htaccess file if you prefer that route.
Frequently asked questions
How do I know which MIME type to enter?
Each format has a standard type — for example application/pdf for PDFs or font/woff2 for fonts. A quick search for "MIME type for [extension]" gives the correct value. Enter it exactly.
My change did not take effect.
Clear your browser cache and try in a private window, since the browser may have cached the file with its old handling. If you set it in .htaccess, double-check the syntax.
Could a wrong MIME type be a security risk?
It can — serving scripts with the wrong type can enable certain attacks. Only add types you actually need, and stick to the standard values for known formats.
Was this article helpful?