summaryrefslogtreecommitdiffstats
path: root/docs/manual/mod/mod_negotiation.html.ja.utf8
blob: 4ab663aa1995b2961bcfbcdb6e739f3e9398adef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<!--
        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
              This file is generated from xml source: DO NOT EDIT
        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      -->
<title>mod_negotiation - Apache HTTP サーバ バージョン 2.4</title>
<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" />
<script src="../style/scripts/prettify.min.js" type="text/javascript">
</script>

<link href="../images/favicon.ico" rel="shortcut icon" /></head>
<body>
<div id="page-header">
<p class="menu"><a href="../mod/">モジュール</a> | <a href="../mod/directives.html">ディレクティブ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">用語</a> | <a href="../sitemap.html">サイトマップ</a></p>
<p class="apache">Apache HTTP サーバ バージョン 2.4</p>
<img alt="" src="../images/feather.png" /></div>
<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
<div id="path">
<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP サーバ</a> &gt; <a href="http://httpd.apache.org/docs/">ドキュメンテーション</a> &gt; <a href="../">バージョン 2.4</a> &gt; <a href="./">モジュール</a></div>
<div id="page-content">
<div id="preamble"><h1>Apache モジュール mod_negotiation</h1>
<div class="toplang">
<p><span>翻訳済み言語: </span><a href="../en/mod/mod_negotiation.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
<a href="../fr/mod/mod_negotiation.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
<a href="../ja/mod/mod_negotiation.html" title="Japanese">&nbsp;ja&nbsp;</a></p>
</div>
<div class="outofdate">この日本語訳はすでに古くなっている
            可能性があります。
            最近更新された内容を見るには英語版をご覧下さい。
        </div>
<table class="module"><tr><th><a href="module-dict.html#Description">説明:</a></th><td><a href="../content-negotiation.html">コンテントネゴシエーション</a>
  機能を提供する</td></tr>
<tr><th><a href="module-dict.html#Status">ステータス:</a></th><td>Base</td></tr>
<tr><th><a href="module-dict.html#ModuleIdentifier">モジュール識別子:</a></th><td>negotiation_module</td></tr>
<tr><th><a href="module-dict.html#SourceFile">ソースファイル:</a></th><td>mod_negotiation.c</td></tr></table>
<h3>概要</h3>

    <p>コンテントネゴシエーション、より正確にはコンテンツの選択機能は、
    複数用意されているドキュメントから、クライアントの能力に一番合った
    ドキュメントを選択する機能です。この実装は二つあります。</p>

    <ul>
      <li>タイプマップ (<code>type-map</code>
      ハンドラで扱われるファイル)。これは variants
      を含んでいるファイルを明示的に指定します。</li>

      <li>MultiViews の探索 (<code>MultiViews</code> <code class="directive"><a href="../mod/core.html#option">Option</a></code> で有効になります)。
      サーバが暗黙の内にファイル名のパターンマッチを行ない、
      その結果から選択します。</li>
    </ul>
</div>
<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><h3>トピック</h3>
<ul id="topics">
<li><img alt="" src="../images/down.gif" /> <a href="#typemaps">タイプマップ</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#multiviews">MultiViews</a></li>
</ul><h3 class="directives">ディレクティブ</h3>
<ul id="toc">
<li><img alt="" src="../images/down.gif" /> <a href="#cachenegotiateddocs">CacheNegotiatedDocs</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#forcelanguagepriority">ForceLanguagePriority</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#languagepriority">LanguagePriority</a></li>
</ul>
<h3>Bugfix checklist</h3><ul class="seealso"><li><a href="https://www.apache.org/dist/httpd/CHANGES_2.4">httpd changelog</a></li><li><a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&amp;list_id=144532&amp;product=Apache%20httpd-2&amp;query_format=specific&amp;order=changeddate%20DESC%2Cpriority%2Cbug_severity&amp;component=mod_negotiation">Known issues</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&amp;component=mod_negotiation">Report a bug</a></li></ul><h3>参照</h3>
<ul class="seealso">
<li><code class="directive"><a href="../mod/core.html#options">Options</a></code></li>
<li><code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code></li>
<li><a href="../content-negotiation.html">コンテントネゴシエーション</a></li>
<li><a href="../env.html">環境変数</a></li>
<li><a href="#comments_section">コメント</a></li></ul></div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="typemaps" id="typemaps">タイプマップ</a></h2>
    <p>タイプマップは RFC 822 のメールヘッダに類似した書式です。
    ドキュメントの記述が空行で分離されて書かれていて、ハッシュ文字
    ('#') で始まる行はコメントとして扱われます。
    ドキュメントの説明は複数のヘッダレコードから構成されます。
    レコードは、続きの行が空白で始まっていると複数の行にまたがります。
    最初の空白が消去されて、前の行とつなげて 1 行として扱われます。
    ヘッダレコードはキーワード名の後に値が続くという形式で、
    キーワード名は常にコロンで終わります。空白はヘッダ名と値の間、
    値のトークンの間に入れることができます。
    使用可能なヘッダは以下のとおりです:</p>

    <dl>
      <dt><code>Content-Encoding:</code></dt>
      <dd>ファイルのエンコーディング。Apache は <code class="directive"><a href="../mod/mod_mime.html#addencoding">AddEncoding</a></code> ディレクティブ
      で定義されたエンコーディングだけを認識します。通常 compress
      されたファイルのための <code>x-compress</code> と gzip
      されたファイルのための <code>x-gzip</code> を含みます。
      エンコーディングの比較をするときは、接頭辞 <code>x-</code>
      は無視されます。</dd>

      <dt><code>Content-Language:</code></dt>
      <dd>インターネット標準の言語タグ 
      (<a href="http://www.ietf.org/rfc/rfc1766.txt">RFC 1766</a>)
      で定義されている言語の種類。例えば、<code>en</code>
      は英語を表します。
      複数の言語が格納される場合はコンマで区切られます。</dd>

      <dt><code>Content-Length:</code></dt>
      <dd>ファイルの長さ (バイト数)。
      このヘッダがない場合、ファイルの実際の長さが使用されます。</dd>

      <dt><code>Content-Type:</code></dt>
      <dd>ドキュメントの <a class="glossarylink" href="../glossary.html#mime-type" title="用語集を参照">MIME
      メディアタイプ</a>、オプショナルなパラメータ付き。パラメータの構文は
      <code>name=value</code>
      で、メディアタイプや他のパラメータとはセミコロンで分離されます。
      共通のパラメータは以下のとおり:

        <dl>
          <dt><code>level</code></dt>
          <dd>メディアタイプのバージョンを示す整数。
          <code>text/html</code> では 2 がデフォルトで、その他の場合は
          0 がデフォルトです。</dd>

          <dt><code>qs</code></dt>
          <dd>クライアントの能力に関係なく、variant
          を他と比較したときの相対的な「品質」で、0.0 から 1.0
          の範囲の浮動点小数。
          例えば、写真を表現しようとしているときは普通は JPEG
          ファイルの方が ASCII ファイルよりも高い品質になります。
          しかし、リソースが ASCII アートで表現されているときは、ASCII
          ファイルの方が JPEG
          ファイルよりも高い品質になります。このように、<code>qs</code>
          はリソース毎に特有の値を取ります。
          </dd>
        </dl>

        <div class="example"><h3>例</h3><p><code>
          Content-Type: image/jpeg; qs=0.8
        </code></p></div>
      </dd>

      <dt><code>URI:</code></dt>
      <dd>(指定のメディアタイプ、コンテントエンコーディングの) variant の
      ファイルの uri.  これは、マップファイルからの相対 URL として
      解釈されます。同じサーバに存在しなければならず、クライアントが
      直接リクエストしたときにアクセスを許可されるものでなければなりません。</dd>

      <dt><code>Body:</code></dt>
      <dd>Apache 2.0 で新設されたこの Body ヘッダを使って、
      リソースの実際の内容をタイプマップファイルに書くことができます。
      このヘッダは本文の内容の区切りとなる文字列で始まる必要があります。
      タイプマップファイルの続く行は、区切り文字列が見つかるまで、
      リソースの本文になります。

      <div class="example"><h3>Example:</h3><p><code>
        Body:----xyz----<br />
        &lt;html&gt;<br />
        &lt;body&gt;<br />
        &lt;p&gt;Content of the page.&lt;/p&gt;<br />
        &lt;/body&gt;<br />
        &lt;/html&gt;<br />
        ----xyz----
      </code></p></div>
      </dd>
    </dl>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="multiviews" id="multiviews">MultiViews</a></h2>
    <p>MultiViews 探索は、<code>Multiviews</code> <code class="directive"><a href="../mod/core.html#options">Options</a></code> ディレクティブにより有効になります。
    サーバが <code>/some/dir/foo</code>
    へのリクエストを受け取り、<code>/some/dir/foo</code> が存在
    <em>しない</em>場合、サーバはディレクトリを読んで、
    <code>foo.*</code> にあてはまる全てのファイルを探し、
    事実上それらのファイルをマップするタイプマップを作ります。
    そのとき、メディアタイプとコンテントエンコーディングは、
    そのファイル名を直接指定したときと同じものが割り当てられます。
    それからクライアントの要求に一番合うものを選び、
    そのドキュメントを返します。</p>

    <p>ファイルを選択する際に、関連するコンテントネゴシエーションの
    メタ情報を持たないファイルについて、判定を行うかどうかを
    <code class="directive"><a href="../mod/mod_mime.html#multiviewsmatch">MultiViewsMatch</a></code>
    ディレクティブで設定します。</p>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="CacheNegotiatedDocs" id="CacheNegotiatedDocs">CacheNegotiatedDocs</a> <a name="cachenegotiateddocs" id="cachenegotiateddocs">ディレクティブ</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>コンテントネゴシエーションされたドキュメントをプロキシサーバが
キャッシュできるようにする</td></tr>
<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>CacheNegotiatedDocs On|Off</code></td></tr>
<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>CacheNegotiatedDocs Off</code></td></tr>
<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト</td></tr>
<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_negotiation</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">互換性:</a></th><td>バージョン 2.0で構文が変わりました</td></tr>
</table>
    <p>このディレクティブが設定されていると、コンテントネゴシエーション
    をした結果のドキュメントのキャッシュを許可します。
    これは、プロキシの後ろにいるクライアントが能力に一番合った
    ドキュメントではなく、
    キャッシュをより効果的にするものを得る可能性があるということです。</p>

    <p>このディレクティブは HTTP/1.0 ブラウザからのリクエスト
    のみに適用されます。HTTP/1.1 は、
    交渉されたドキュメントのキャッシュに対してずっとよい制御が可能なので、
    このディレクティブは HTTP/1.1 のリクエストには影響しません。</p>
    <p>2.0 より前のバージョンでは、
    <code class="directive">CacheNegotiatedDocs</code> は引数を取らず、
    ディレクティブが存在することで on の動作をしていました。</p>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ForceLanguagePriority" id="ForceLanguagePriority">ForceLanguagePriority</a> <a name="forcelanguagepriority" id="forcelanguagepriority">ディレクティブ</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>要求に合う単独のドキュメントが見つからなかったときに行なうことを指定
</td></tr>
<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>ForceLanguagePriority None|Prefer|Fallback [Prefer|Fallback]</code></td></tr>
<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>ForceLanguagePriority Prefer</code></td></tr>
<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト, ディレクトリ, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">上書き:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_negotiation</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">互換性:</a></th><td>バージョン 2.0.30 以降で使用可能</td></tr>
</table>
    <p><code class="directive">ForceLanguagePriority</code> ディレクティブは
    要求に合うドキュメントを一つだけ返すことができないときに、
    <code class="directive"><a href="#languagepriority">LanguagePriority</a></code>
    ディレクティブを使ってネゴシエーションの結果を返します。</p>

    <p><code>ForceLanguagePriority Prefer</code> は、同等の選択肢が
    いくつかあるときに、HTTP の 300 (MULTIPLE CHOICES) を返す代わりに、
    <code>LanguagePriority</code> を使って一つだけドキュメントを返すように
    します。以下のディレクティブが指定されていて、ユーザの <code>Accept-Language</code>
    ヘッダでは <code>en</code> と <code>de</code> の品質が共に
    <code>.500</code> (同じくらい許容) であるときは、
    最初にマッチする variant の <code>en</code> が送られます。</p>

    <div class="example"><p><code>
      LanguagePriority en fr de<br />
      ForceLanguagePriority Prefer
    </code></p></div>

    <p><code>ForceLanguagePriority Fallback</code> では、HTTP 406
    (NOT ACCEPTABLE) を送信する代わりに、
    <code class="directive"><a href="#languagepriority">LanguagePriority</a></code>
    が正しい結果を送ります。
    以下のディレクティブが指定されていて、ユーザの <code>Accept-Language</code>
    が <code>es</code> 言語のみを許可していて、さらにそのような variant がないときには、
    以下の <code class="directive"><a href="#languagepriority">LanguagePriority</a></code>
    のリストの最初の variant が送られます。</p>

    <div class="example"><p><code>
      LanguagePriority en fr de<br />
      ForceLanguagePriority Fallback
    </code></p></div>

    <p><code>Prefer</code> と <code>Fallback</code> の両方のオプションを
    同時に指定することができます。
    ですから、複数の variant があるときは
    <code class="directive"><a href="#languagepriority">LanguagePriority</a></code> の最初の
    variant が送られ、クライアントの許容言語に合う vaiant がないときは
    存在するドキュメントで最初のものが送られる、という様にすることができます。</p>

<h3>参照</h3>
<ul>
<li><code class="directive"><a href="../mod/mod_mime.html#addlanguage">AddLanguage</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="LanguagePriority" id="LanguagePriority">LanguagePriority</a> <a name="languagepriority" id="languagepriority">ディレクティブ</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>クライアントが優先度を示さなかったときの言語の variant の優先度を
指定</td></tr>
<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>LanguagePriority <var>MIME-lang</var> [<var>MIME-lang</var>]
...</code></td></tr>
<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト, ディレクトリ, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">上書き:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_negotiation</td></tr>
</table>
    <p><code class="directive">LanguagePriority</code> は、MultiViews
    リクエストを扱うときに、クライアントが優先順位を提供していない場合の
    言語の優先順位を設定します。<var>MIME-lang</var>
    のリストが優先度の降順に並びます。</p>

    <div class="example"><h3>Example:</h3><p><code>
      LanguagePriority en fr de
    </code></p></div>

    <p><code>foo.html</code> がリクエストされ、<code>foo.html.fr</code>
    と <code>foo.html.de</code> が両方存在し、
    ブラウザが言語の優先順位を提供してない場合は
    <code>foo.html.fr</code> が返されます。</p>

    <p>このディレクティブは他の方法で「最善」
    の言語が決定できないときか、<code class="directive"><a href="#forcelanguagepriority">ForceLanguagePriority</a></code> ディレクティブが
    <code>None</code> 以外のときにのみ効果があることに注意してください。
    一般的には、サーバ側ではなくクライアント側で好みの言語を決定します。</p>

<h3>参照</h3>
<ul>
<li><code class="directive"><a href="../mod/mod_mime.html#addlanguage">AddLanguage</a></code></li>
</ul>
</div>
</div>
<div class="bottomlang">
<p><span>翻訳済み言語: </span><a href="../en/mod/mod_negotiation.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
<a href="../fr/mod/mod_negotiation.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
<a href="../ja/mod/mod_negotiation.html" title="Japanese">&nbsp;ja&nbsp;</a></p>
</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">コメント</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our <a href="https://httpd.apache.org/lists.html">mailing lists</a>.</div>
<script type="text/javascript"><!--//--><![CDATA[//><!--
var comments_shortname = 'httpd';
var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_negotiation.html';
(function(w, d) {
    if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
        d.write('<div id="comments_thread"><\/div>');
        var s = d.createElement('script');
        s.type = 'text/javascript';
        s.async = true;
        s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
        (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
    }
    else { 
        d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
    }
})(window, document);
//--><!]]></script></div><div id="footer">
<p class="apache">Copyright 2023 The Apache Software Foundation.<br />この文書は <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> のライセンスで提供されています。.</p>
<p class="menu"><a href="../mod/">モジュール</a> | <a href="../mod/directives.html">ディレクティブ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">用語</a> | <a href="../sitemap.html">サイトマップ</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
if (typeof(prettyPrint) !== 'undefined') {
    prettyPrint();
}
//--><!]]></script>
</body></html>