Help us understand the problem. What is going on with this article?

HTML5時代の Contents-type 設定

More than 5 years have passed since last update.

サーバー設定の確認

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 タグ周り
    • それ以外のマニアックなヤツ
Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away