github.com/krum110487/go-htaccess@v0.0.0-20240316004156-60641c8e7598/tests/data/apache_2_2_34/manual/custom-error.html.ja.utf8 (about) 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"><head> 4 <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> 5 <!-- 6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 7 This file is generated from xml source: DO NOT EDIT 8 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 9 --> 10 <title>カスタムエラーレスポンス - Apache HTTP サーバ バージョン 2.2</title> 11 <link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> 12 <link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> 13 <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" /> 14 <script src="./style/scripts/prettify.min.js" type="text/javascript"> 15 </script> 16 17 <link href="./images/favicon.ico" rel="shortcut icon" /><link href="http://httpd.apache.org/docs/current/custom-error.html" rel="canonical" /></head> 18 <body id="manual-page"><div id="page-header"> 19 <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> 20 <p class="apache">Apache HTTP サーバ バージョン 2.2</p> 21 <img alt="" src="./images/feather.gif" /></div> 22 <div class="up"><a href="./"><img title="<-" alt="<-" src="./images/left.gif" /></a></div> 23 <div id="path"> 24 <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP サーバ</a> > <a href="http://httpd.apache.org/docs/">ドキュメンテーション</a> > <a href="./">バージョン 2.2</a></div><div id="page-content"><div class="retired"><h4>Please note</h4> 25 <p> This document refers to a legacy release (<strong>2.2</strong>) of Apache httpd. The active release (<strong>2.4</strong>) is documented <a href="http://httpd.apache.org/docs/current">here</a>. If you have not already upgraded, please follow <a href="http://httpd.apache.org/docs/current/upgrading.html">this link</a> for more information.</p> 26 <p>You may follow <a href="http://httpd.apache.org/docs/current/custom-error.html">this link</a> to go to the current version of this document.</p></div><div id="preamble"><h1>カスタムエラーレスポンス</h1> 27 <div class="toplang"> 28 <p><span>翻訳済み言語: </span><a href="./en/custom-error.html" hreflang="en" rel="alternate" title="English"> en </a> | 29 <a href="./es/custom-error.html" hreflang="es" rel="alternate" title="Español"> es </a> | 30 <a href="./ja/custom-error.html" title="Japanese"> ja </a> | 31 <a href="./ko/custom-error.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | 32 <a href="./tr/custom-error.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> 33 </div> 34 <div class="outofdate">この日本語訳はすでに古くなっている 35 可能性があります。 36 最近更新された内容を見るには英語版をご覧下さい。 37 </div> 38 39 <p>ウェブマスターが何らかのエラーや問題に対する 40 Apache の反応を設定できるようにする追加機能を提供します。</p> 41 42 <p>サーバがエラーや問題を発見した場合の反応を、 43 カスタマイズして定義することができます。</p> 44 45 <p>スクリプトの実行が失敗して "500 Server Error" 46 を発生させたとします。この場合の反応を、より好ましいテキストや、別の 47 URL (内部及び外部) へのリダイレクションに置き換えることができます。 48 </p> 49 </div> 50 <div id="quickview"><ul id="toc"><li><img alt="" src="./images/down.gif" /> <a href="#behavior">動作</a></li> 51 <li><img alt="" src="./images/down.gif" /> <a href="#configuration">設定</a></li> 52 <li><img alt="" src="./images/down.gif" /> <a href="#custom">カスタムエラーレスポンスとリダイレクト</a></li> 53 </ul><ul class="seealso"><li><a href="#comments_section">コメント</a></li></ul></div> 54 <div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> 55 <div class="section"> 56 <h2><a name="behavior" id="behavior">動作</a></h2> 57 58 59 <h3>古い動作</h3> 60 61 62 <p>NCSA httpd 1.3 は、古くて退屈なエラー/問題メッセージを 63 返していました。それはしばしばユーザには無意味であり、 64 またそれを発生させた原因を記録する方法も提供していませんでした。</p> 65 66 67 <h3>新しい動作</h3> 68 69 70 <ol> 71 <li>NCSA のハードコードされたメッセージの代わりに 72 他のテキストを表示</li> 73 74 <li>ローカルの URL にリダイレクト</li> 75 76 <li>外部の URL にリダイレクト</li> 77 </ol> 78 79 <p>するようにサーバを設定できます。</p> 80 81 <p>別の URL にリダイレクトすることは役に立ちますが、 82 それは説明をしたり、より明確に誤り/問題を記録したりするために 83 何か情報を伝えられるときに限ります。</p> 84 85 <p>これを実現するために、 Apache は新しく CGI のような環境変数を 86 定義します:</p> 87 88 <div class="example"><p><code> 89 REDIRECT_HTTP_ACCEPT=*/*, image/gif, 90 image/x-xbitmap, image/jpeg<br /> 91 REDIRECT_HTTP_USER_AGENT=Mozilla/1.1b2 (X11; I; HP-UX 92 A.09.05 9000/712)<br /> 93 REDIRECT_PATH=.:/bin:/usr/local/bin:/etc<br /> 94 REDIRECT_QUERY_STRING=<br /> 95 REDIRECT_REMOTE_ADDR=121.345.78.123<br /> 96 REDIRECT_REMOTE_HOST=ooh.ahhh.com<br /> 97 REDIRECT_SERVER_NAME=crash.bang.edu<br /> 98 REDIRECT_SERVER_PORT=80<br /> 99 REDIRECT_SERVER_SOFTWARE=Apache/0.8.15<br /> 100 REDIRECT_URL=/cgi-bin/buggy.pl 101 </code></p></div> 102 103 <p>頭に付く <code>REDIRECT_</code> に注目してください。</p> 104 105 <p>少なくとも <code>REDIRECT_URL</code> と 106 <code>REDIRECT_QUERY_STRING</code> は新しい URL (CGI スクリプトか 107 CGI インクルードであると仮定されます) に渡されます。 108 他の変数は、エラーや問題が起きる前に存在した場合にだけ存在します。 109 もしあなたの設定した <code class="directive"><a href="./mod/core.html#errordocument">ErrorDocument</a></code> が <em>外部</em>リダイレクト 110 (<em>すなわち</em>、<code>http:</code> 111 のような体系名から始まるすべてのもの。たとえ同じホストを指していても) 112 ならば、これらは<strong>まったく</strong>設定されません。</p> 113 114 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> 115 <div class="section"> 116 <h2><a name="configuration" id="configuration">設定</a></h2> 117 118 119 <p><code class="directive"><a href="./mod/core.html#allowoverride">AllowOverride</a></code> が適切に設定されていれば、 120 .htaccess ファイルで <code class="directive"><a href="./mod/core.html#errordocument">ErrorDocument</a></code> 121 を使用することができます。</p> 122 123 <p>ここに、いくつかの例を挙げます。</p> 124 125 <div class="example"><p><code> 126 ErrorDocument 500 /cgi-bin/crash-recover <br /> 127 ErrorDocument 500 "Sorry, our script crashed. Oh dear" <br /> 128 ErrorDocument 500 http://xxx/ <br /> 129 ErrorDocument 404 /Lame_excuses/not_found.html <br /> 130 ErrorDocument 401 /Subscription/how_to_subscribe.html 131 </code></p></div> 132 133 <p>構文</p> 134 135 <div class="example"><p><code> 136 ErrorDocument <3-digit-code> <action> 137 </code></p></div> 138 139 <p>action (動作) は、</p> 140 141 <ol> 142 <li>表示されるべきテキスト。テキストには引用符 (") をつけます。 143 引用符の後に続くものが何でも表示されます。 144 <em>注意 : (") は表示されません</em></li> 145 146 <li>リダイレクト先の外部 URL </li> 147 148 <li>リダイレクト先のローカル URL </li> 149 </ol> 150 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> 151 <div class="section"> 152 <h2><a name="custom" id="custom">カスタムエラーレスポンスとリダイレクト</a></h2> 153 154 155 <p>スクリプト/SSI に追加の環境変数が利用可能になるように、 156 リダイレクトされた URL に対する Apache の動作が変更されました。</p> 157 158 <h3>古い動作</h3> 159 160 161 <p>リダイレクトされたスクリプトは標準の CGI 162 環境変数を利用可能でした。しかし、どこからリダイレクト 163 されたかの情報は提供されていませんでした。</p> 164 165 166 <h3>新しい動作</h3> 167 168 169 <p>リダイレクトされた先のスクリプトが使用可能なように、 170 新しいたくさんの環境変数が初期化されます。新しい変数は、それぞれ 171 <code>REDIRECT_</code> で始まります。 172 <code>REDIRECT_</code> で始まる環境変数はリダイレクトされる前に存在していた 173 CGI 環境変数の頭に <code>REDIRECT_</code> を付けて作成されます。 174 <em>すなわち</em>、<code>HTTP_USER_AGENT</code> は 175 <code>REDIRECT_HTTP_USER_AGENT</code> になります。 176 これらの新しい変数に加えて、Apache は、 177 スクリプトがリダイレクト元のトレースを助けるために 178 <code>REDIRECT_URL</code> と <code>REDIRECT_STATUS</code> 179 を定義します。アクセスログには元の URL とリダイレクトされた URL 180 の両方が記録されます。</p> 181 182 <p>ErrorDocument が CGI スクリプトへのローカルリダイレクトを 183 指定している場合は、それを起動することになったエラーの状態を 184 クライアントまで確実に伝えるために <code>"Status:" </code> 185 ヘッダを含むべきです。例えば、ErrorDocument 用の Perl 186 スクリプトは以下のようなものを含むかもしれません。 187 </p> 188 189 <div class="example"><p><code> 190 ... <br /> 191 print "Content-type: text/html\n"; <br /> 192 printf "Status: %s Condition Intercepted\n", $ENV{"REDIRECT_STATUS"}; <br /> 193 ... 194 </code></p></div> 195 196 <p>スクリプトが <code>404 Not Found</code> のような 197 特定のエラーコンディションを扱うためだけに使われる場合は、 198 代わりに特定のコードとエラーテキストを使用することができます。</p> 199 200 </div></div> 201 <div class="bottomlang"> 202 <p><span>翻訳済み言語: </span><a href="./en/custom-error.html" hreflang="en" rel="alternate" title="English"> en </a> | 203 <a href="./es/custom-error.html" hreflang="es" rel="alternate" title="Español"> es </a> | 204 <a href="./ja/custom-error.html" title="Japanese"> ja </a> | 205 <a href="./ko/custom-error.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | 206 <a href="./tr/custom-error.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> 207 </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&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again 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 Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> 208 <script type="text/javascript"><!--//--><![CDATA[//><!-- 209 var comments_shortname = 'httpd'; 210 var comments_identifier = 'http://httpd.apache.org/docs/2.2/custom-error.html'; 211 (function(w, d) { 212 if (w.location.hostname.toLowerCase() == "httpd.apache.org") { 213 d.write('<div id="comments_thread"><\/div>'); 214 var s = d.createElement('script'); 215 s.type = 'text/javascript'; 216 s.async = true; 217 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; 218 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); 219 } 220 else { 221 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); 222 } 223 })(window, document); 224 //--><!]]></script></div><div id="footer"> 225 <p class="apache">Copyright 2017 The Apache Software Foundation.<br />この文書は <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> のライセンスで提供されています。.</p> 226 <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[//><!-- 227 if (typeof(prettyPrint) !== 'undefined') { 228 prettyPrint(); 229 } 230 //--><!]]></script> 231 </body></html>