Add MIME types

mime, content-type, htaccess, webmanifest, download · 0 found this helpful

A MIME type tells the browser what a file is. A .pdf gets application/pdf and opens in a viewer. If the server doesn't know a file ending, the browser may show it as plain text or refuse to use it. You rarely need this, but a newer file type sometimes does.

Option 1: File types in your account

  1. Open Account → Hosting → your site → Files. Under Folder and server rules, click Manage, and find File types (MIME).
  2. Enter the MIME type, for example application/manifest+json.
  3. Enter the Extensions without a dot: webmanifest.
  4. Click Add.

Option 2: .htaccess

# Teach the server about extra file types
AddType application/manifest+json .webmanifest
AddType font/woff2 .woff2
AddType image/avif .avif
AddType video/mp4 .mp4

# Force a download instead of opening in the browser
<FilesMatch "\.(zip|csv)$">
  Header set Content-Disposition "attachment"
</FilesMatch>

Check it

curl -I https://example.ca/site.webmanifest

Look for content-type: application/manifest+json.

If something goes wrong

  • No change: a cache holds the old header. Clear your browser cache and any LiteSpeed Cache or CDN cache.
  • 500 error: the Header line needs mod_headers. Wrap it in <IfModule mod_headers.c>.
  • Download opens in the browser: add the Content-Disposition rule above.

See .htaccess basics for safe editing.

Was this helpful?

Still stuck? Ask us and we'll walk you through it.