LoginSignup
5
6

More than 5 years have passed since last update.

HTML5時代の Contents-type 設定

Last updated at Posted at 2012-11-03

サーバー設定の確認

HTML5になって,新しい拡張子/ファイルタイプがいろいろ出ているが,
サーバー側で正しいレスポンスヘッダーが出力できていないの事があるのでメモ.

手元のApacheには、httpd.conf に以下の設定がデフォルトでしてある.

httpd.conf
LoadModule mime_module modules/mod_mime.so
TypesConfig /etc/mime.types

この設定ファイルの中身は

/etc/mime.types
text/html                   html htm

の用な, Contents-typeと拡張子のペアがひたすら書いてある.

基本的には,このリストに書いていないものを追記すれば良さそう.

追記する設定

まだいろいろ試行錯誤中なので, 後から変更しやすい.htaccessに書いておこう.

/etc/mime.types
AddType text/cache-manifest .appcache
AddType image/svg+xml .svg
AddType font/woff .woff
AddType font/ttf .ttf
AddType video/mp4 .mp4

結果的にこんな感じ.

TODO

  • それぞれのファイルを設置して動作検証
  • その他のフォーマットを調べて追記
    • 特に Video, Audio タグ周り
    • それ以外のマニアックなヤツ
5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6