Apache .htaccess Entry For Serving Correct MimeType For Some Of The More Common File-Types

Posted at

Put this part in your .htaccess to make sure your files are served with correct mimetype, and will eventually trigger the target-browser/OS, proper, handler.

<IfModule mod_mime.c> 
AddType application/font-woff woff
AddType application/javascript js
AddType application/octet-stream safariextz
AddType application/vnd.ms-fontobject eot
AddType application/x-chrome-extension crx
AddType application/x-font-ttf ttf ttc
AddType application/x-font-woff woff
AddType application/x-mpegurl m3u8
AddType application/x-xpinstall xpi
AddType audio/mp4 m4a
AddType audio/mpeg mp3
AddType audio/ogg oga ogg
AddType font/opentype otf
AddType image/webp webp
AddType image/x-icon ico
AddType text/cache-manifest appcache manifest
AddType text/plain srt sub ssa
AddType text/vtt vtt
AddType text/x-component htc
AddType text/x-vcard vcf
AddType video/3gpp 3gp
AddType video/mp2t ts
AddType video/mp4 mp4 m4v
AddType video/ogg ogv ogg
AddType video/quicktime mov
AddType video/x-ms-wmv wmv
AddType video/webm webm
AddType video/x-flv flv
AddType video/x-msvideo avi

  # Web application-manifests. [https://github.com/mdn/to-do-notifications/blob/gh-pages/.htaccess]
AddType application/x-web-app-manifest+json webapp

  # SVG.
  # Required for svg webfonts on iPad [twitter.com/FontSquirrel/status/14855840545]
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
</IfModule>