Development and databases
MIME types
MIME types are standardised names that describe the format of some content. For example, a PDF file uses application/pdf.
The server sends them to the browser in the Content-Type HTTP header, which lets it decide how to process or display the response. A wrong mapping can make a file download, be interpreted incorrectly or be blocked.
In a modern HTML document, the usual meta tag declares the character encoding; it does not replace the MIME type the server sends:
<meta charset="utf-8">
The server must still send that document as text/html; charset=utf-8.
The official reference for registered types is the IANA media types registry.
MIME Types in cPanel lets you map a custom extension to an existing MIME type. This feature is rarely used because the server already includes hundreds of system mappings, which cannot be removed from this interface.
Add a mapping
In cPanel > MIME Types, enter the type and the extension your application needs and save. Do not replace common mappings without knowing what content each file serves; changing the type does not convert its format.
Then open a test file and check Network in the browser's developer tools. Check the Content-Type of the real response, not just the URL's extension. If an application or a CDN responds, its configuration may take precedence over the cPanel mapping.
To undo a mapping of your own, delete it from the list and check again. System mappings cannot be removed from that screen.
If what you need is to run a file as PHP, do not solve it by giving it an arbitrary MIME type: check the PHP interpreter and version. The type describes the response; the handler determines how the file is processed.
You may also find useful
- Customise 404 and other error pages Customise from cPanel the responses for errors such as 404, with request codes and tags, and tell wh...
- Apache handlers Set from cPanel which Apache handler should process a given extension, and learn why this option cal...
- Available binaries and tools - FFmpeg, Tesseract, ImageMagick, cURL and more See which binaries are available for video, images, PDF, OCR, networking, DNS, version control and o...
- Create and run cron jobs in cPanel Set up cron jobs in cPanel, define intervals and commands, manage notifications, call URLs with cURL...
Something wrong or out of date? Tell us and we will review it.