UnderHost
Knowledgebase Docs

MIME types in cPanel: configure file extensions

Add custom MIME types in cPanel or .htaccess so browsers handle WebP, fonts, JSON, video, and other file types correctly.

On this page

MIME types tell browsers what kind of file the server is sending. If a MIME type is missing or wrong, a file may download instead of display, fail to load as a font, or be blocked by the browser.

What MIME types do

A MIME type pairs a file extension with a content type, such as .webp with image/webp or .json with application/json. Most common types are already configured by the server, so only add custom entries when a file type is not being handled correctly.

Add a MIME type in cPanel

  1. Log in to cPanel.
  2. Open Advanced and choose MIME Types.
  3. Enter the MIME type, such as image/webp.
  4. Enter the extension without a dot, such as webp.
  5. Click Add.

Common examples

ExtensionMIME typeUse
webpimage/webpModern image format.
woff2font/woff2Web fonts.
svgimage/svg+xmlSVG images.
jsonapplication/jsonAPI and app data.
mp4video/mp4Video files.

Set MIME types in .htaccess

If the cPanel MIME Types tool is not available, add entries to the site's .htaccess file:

AddType image/webp .webp
AddType font/woff2 .woff2
AddType image/svg+xml .svg
AddType application/json .json

Troubleshooting

  • Clear browser and CDN cache after adding a MIME type.
  • Check the browser developer tools Network tab to confirm the Content-Type response header.
  • Remove duplicate or conflicting AddType rules from nested .htaccess files.
  • If a 500 error appears after editing .htaccess, revert the last change and check cPanel error logs.

Related: Advanced .htaccess in cPanel: redirects, PHP settings, and access rules | cPanel File Manager: upload, edit, organize, and delete files | How to enable PHP extensions in cPanel

Was this article helpful?

Need cPanel hosting or licensing?

Use UnderHost cPanel hosting or add cPanel/WHM to a VPS or dedicated server for familiar website, email, DNS, and database management.

Related articles

Back to cPanel