The extension ↔ MIME mappings a web server actually needs — fonts (woff2), images (avif, webp), documents, archives — with the practical notes: why text/javascript replaced application/javascript, what image/x-icon still gets away with.
Look up in either direction: type ".pdf" for the MIME type, or paste "font/woff2" for the extensions.
Frequently asked questions
Why does .js map to text/javascript?
That is the current WHATWG/IANA registration; application/javascript is the deprecated legacy spelling and may be rejected by strict servers.
What do I serve unknown files as?
application/octet-stream — it forces a download instead of the browser guessing (and executing) a content type.
中文说明
Web 服务器真正会用到的扩展名 ↔ MIME 映射——字体(woff2)、图片(avif、webp)、文档、压缩包——并附实践备注:为什么 text/javascript 取代了 application/javascript、image/x-icon 为何还能通用。
双向查询:输入 ".pdf" 查 MIME 类型,或粘贴 "font/woff2" 查扩展名。
常见问题
为什么 .js 映射到 text/javascript?
这是 WHATWG/IANA 的现行注册;application/javascript 是弃用的旧写法,严格的服务器可能拒绝。
未知文件该用什么类型?
application/octet-stream——强制下载,避免浏览器自行猜测(甚至执行)内容类型。