Managing MIME Types in DirectAdmin
Summary
This guide explains how to view and manage MIME Types in DirectAdmin. MIME Types tell the browser how to handle specific file extensions, such as displaying images, downloading files, or running scripts.
Overview
MIME Types define the content type of files served by your website. They ensure that browsers correctly interpret files such as images, videos, scripts, and documents. DirectAdmin allows you to add custom MIME Types for uncommon or proprietary file formats.
Requirements
- DirectAdmin user-level access
- A domain hosted on the server
- Basic understanding of file extensions and content types
Step-by-Step Instructions
1. Access MIME Types
- Log in to DirectAdmin
- Go to Advanced Features → MIME Types
- Select the domain you want to manage
2. Add a New MIME Type
- Click “Add MIME Type”
- Enter the MIME type (example: application/json)
- Enter the file extension (example: .json)
- Click “Create”
3. Common MIME Type Examples
JSON files:
MIME Type: application/json
Extension: .json
SVG images:
MIME Type: image/svg+xml
Extension: .svg
MP4 video:
MIME Type: video/mp4
Extension: .mp4
WebP images:
MIME Type: image/webp
Extension: .webp
Force download of files:
MIME Type: application/octet-stream
Extension: .zip (or any file you want downloaded)
4. Remove a MIME Type
- Go to MIME Types
- Find the entry in the list
- Click “Delete”
- Confirm removal
5. How MIME Types Work
MIME Types help browsers understand:
- Whether to display a file (images, text, video)
- Whether to download a file (archives, executables)
- How to process scripts or structured data
They do not affect server-side execution — only how the browser handles the file.
Troubleshooting
Browser Downloads File Instead of Displaying It
- Ensure the correct MIME Type is set
- Remove conflicting MIME Types
- Check .htaccess for overrides
Images Not Displaying
- Confirm the MIME Type matches the file format
- Ensure the extension starts with a dot (example: .svg)
Custom File Types Not Recognized
- Add the correct MIME Type manually
- Verify the file extension is correct
Security Warning
Avoid assigning executable MIME Types to non-executable files.
Example: Do NOT map .txt or .html to application/x-httpd-php.
Related Articles
- Apache Handlers
- PHP Settings
- Custom Error Pages
- Directory Password Protection
- Cron Jobs