{"id":10025,"date":"2016-01-23T14:00:30","date_gmt":"2016-01-23T05:00:30","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=10025"},"modified":"2018-11-14T16:33:46","modified_gmt":"2018-11-14T07:33:46","slug":"http-redirection-status-code","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2016\/01\/23\/http-redirection-status-code\/","title":{"rendered":"HTTP : \u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u306f\u306a\u305c\u5206\u304b\u308a\u306b\u304f\u3044\u306e\u304b"},"content":{"rendered":"
\u73fe\u5728\u3001URL \u30ea\u30c0\u30a4\u30ec\u30af\u30c8 (URL redirection) \u3092\u7528\u9014\u3068\u3059\u308b\u4e3b\u306a HTTP \u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u306f 301, 302, 303, 307, 308 \u306e 5 \u3064\u3067\u3059\u3002<\/p>\n
\u3053\u308c\u3089\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u306b\u3064\u3044\u3066\u79c1\u306e\u307e\u308f\u308a\u306e\u30a8\u30f3\u30b8\u30cb\u30a2\u306b\u8a71\u3092\u805e\u3044\u3066\u307f\u305f\u3068\u3053\u308d\u3001\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u51e6\u7406\u3092\u66f8\u3053\u3046\u3068\u3059\u308b\u90fd\u5ea6\u3001\u3069\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u304c\u4f55\u3060\u3063\u305f\u304b\u3084\u3001\u7d30\u304b\u3044\u4ed5\u69d8\u306e\u9055\u3044\u306b\u3064\u3044\u3066\u8abf\u3079\u308b\u65b9\u304c\u591a\u3044\u3088\u3046\u3067\u3059\u3002\u79c1\u3082\u5e38\u3005\u3001\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u7cfb\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u306f\u3001\u308f\u304b\u308a\u3065\u3089\u304f\u3001\u61b6\u3048\u306b\u304f\u3044\u3068\u611f\u3058\u3066\u3044\u307e\u3057\u305f\u3002\u305d\u3057\u3066\u3053\u306e\u539f\u56e0\u306f\u3001\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u5b9a\u7fa9\u306e\u5909\u9077\u306b\u3042\u308b\u3068\u8003\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n
\u3053\u306e\u8a18\u4e8b\u306f\u3001\u3053\u306e\u300c\u308f\u304b\u308a\u3065\u3089\u304f\u3001\u61b6\u3048\u306b\u304f\u3044\u300d\u3068\u3044\u3046\u30b9\u30c8\u30ec\u30b9\u306e\u8efd\u6e1b\u3092\u76ee\u7684\u306b\u3001\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u5b9a\u7fa9\u306e\u6b74\u53f2\u306b\u3064\u3044\u3066 RFC \u304b\u3089\u3072\u3082\u89e3\u3044\u3066\u307f\u3088\u3046\u3068\u3044\u3046\u500b\u4eba\u7684\u306a\u8a66\u307f\u306e\u8a18\u9332\u3067\u3059\u3002<\/p>\n
\u307e\u305a\u306f\u80cc\u666f\u3092\u77e5\u308b\u4e0a\u3067\u3001\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u306b\u95a2\u3059\u308b RFC \u7b56\u5b9a\u306e\u6d41\u308c\u3092\u6574\u7406\u3057\u307e\u3059\u3002<\/p>\n
\u4eca\u56de\u6271\u3046\u306e\u306f HTTP\/1.1 \u307e\u3067\u3067\u3059\u3002<\/p>\n
\u6052\u4e45\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306b\u95a2\u3059\u308b\u4ed5\u69d8\u7b56\u5b9a\u3001\u5909\u66f4\u306e\u6d41\u308c\u3092\u8ffd\u3063\u3066\u307f\u307e\u3059\u3002<\/p>\n
1996 \u5e74\u306b\u51fa\u3055\u308c\u305f RFC1945 \u306e\u5b9a\u7fa9\u3092\u8aad\u3080\u3068\u3001301 Moved Permanently \u306b\u3064\u3044\u3066\u3053\u3046\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n
9.3 Redirection 3xx - 301 Moved Permanently (RFC1945)<\/a><\/p>\n If the 301 status code is received in response to a request using the POST method, the user agent must not automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.<\/p><\/blockquote>\n \u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u9762\u306e\u914d\u616e\u3060\u3068\u601d\u3044\u307e\u3059\u304c\u3001POST \u3067\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5bfe\u3059\u308b 301 \u30ec\u30b9\u30dd\u30f3\u30b9\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u5074\u3067\u81ea\u52d5\u7684\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3057\u306a\u3044\u3088\u3046\u6c7a\u3081\u3089\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u6642\u306e\u518d POST \u306b\u95a2\u3059\u308b\u5236\u9650\u3068\u8aad\u3081\u308b\u306e\u3067\u3001301 Moved Permanently \u306f\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u6642\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u30e1\u30bd\u30c3\u30c9\u3092\u5909\u66f4\u3057\u306a\u3044\u3053\u3068\u3092\u60f3\u5b9a\u3057\u3066\u3044\u308b\u3068\u3046\u304b\u304c\u3048\u307e\u3059\u3002<\/p>\n \u6ce8\u91c8\u3092\u898b\u308b\u3068\u3001\u65e2\u5b58\u30e6\u30fc\u30b6\u30fc\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u3044\u304f\u3064\u304b\u306f\u3001POST \u306b\u5bfe\u3059\u308b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3092\u300c\u8aa4\u3063\u3066\u300d GET \u306b\u5909\u66f4\u3057\u3066\u3057\u307e\u3046\u3068\u3044\u3046\u72b6\u6cc1\u306b\u3064\u3044\u3066\u3082\u8a18\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n 9.3 Redirection 3xx - 301 Moved Permanently (RFC1945)<\/a><\/p>\n Note: When automatically redirecting a POST request after receiving a 301 status code, some existing user agents will erroneously change it into a GET request.<\/p><\/blockquote>\n \u3053\u306e\u72b6\u6cc1\u3092\u8e0f\u307e\u3048\u30012014 \u5e74\u306e RFC7231 \u306b\u3066 301 Moved Permanently \u306f POST \u304b\u3089 GET \u3078\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u30e1\u30bd\u30c3\u30c9\u5909\u66f4\u304c\u8a31\u5bb9\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n 6.4.2. 301 Moved Permanently (RFC7231)<\/a><\/p>\n Note: For historical reasons, a user agent MAY change the request method from POST to GET for the subsequent request. If this behavior is undesired, the 307 Temporary Redirect) status code can be used instead.<\/p><\/blockquote>\n \u307e\u305f\u3001\u3053\u3053\u306b\u306f\u30ea\u30af\u30a8\u30b9\u30c8\u30e1\u30bd\u30c3\u30c9\u3092\u5909\u66f4\u3057\u306a\u3044\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306b\u3064\u3044\u3066\u30011999 \u5e74\u306e RFC2616 \u3067\u8ffd\u52a0\u3055\u308c\u305f\u4e00\u6642\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3067\u3042\u308b 307 Temporary Redirect \u3092\u4f7f\u3063\u3066\u826f\u3044\u3068\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u304c\u3001 2014 \u5e74\u306e RFC7238 \u3067 308 Permanent Redirect \u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n \u4e00\u6642\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306b\u3064\u3044\u3066\u3082\u8fbf\u3063\u3066\u307f\u307e\u3059\u3002<\/p>\n \u307e\u305a 1996 \u5e74\u306b\u51fa\u3055\u308c\u305f RFC1945 \u3067 302 Moved Temporarily \u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001301 Moved Permanently \u3068\u540c\u69d8\u3001\u5f53\u521d\u306f\u30ea\u30af\u30a8\u30b9\u30c8\u30e1\u30bd\u30c3\u30c9\u306e\u5909\u66f4\u3092\u8a31\u53ef\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n \u3057\u304b\u3057 1999 \u5e74 RFC2616 \u306b\u306a\u308b\u3068\u3001302 \u306e Resason-Phrase \u304c Found \u306b\u5909\u66f4\u3055\u308c\u307e\u3059\u3002\u4ed5\u69d8\u306b\u3064\u3044\u3066\u5927\u304d\u304f\u5909\u66f4\u3055\u308c\u305f\u8a33\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u540c RFC2616 \u306b\u3066\u8ffd\u52a0\u3055\u308c\u305f 307 Temporary Redirect \u3068\u3001\u5c11\u3057\u9061\u3063\u3066 1997 \u5e74\u306e RFC2068 \u3067\u8ffd\u52a0\u3055\u308c\u305f 303 See Other \u3092\u4f7f\u3044\u5206\u3051\u308b\u3053\u3068\u3067\u3001\u5f79\u5272\u3092\u660e\u78ba\u306b\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n 10.3.3 302 Found (RFC2616)<\/a><\/p>\n Note: RFC 1945 and RFC 2068 specify that the client is not allowed to change the method on the redirected request. However, most existing user agent implementations treat 302 as if it were a 303 response, performing a GET on the Location field-value regardless of the original request method. The status codes 303 and 307 have been added for servers that wish to make unambiguously clear which kind of reaction is expected of the client.<\/p><\/blockquote>\n 301 Moved Permanently \u306b\u5bfe\u3059\u308b 308 Permanent Redirect \u3068\u540c\u69d8\u3001307 Temporary Redirect \u306f\u30ea\u30af\u30a8\u30b9\u30c8\u30e1\u30bd\u30c3\u30c9\u5909\u66f4\u3092\u8a31\u53ef\u3057\u306a\u3044\u4ed5\u69d8\u306b\u306a\u3063\u3066\u304a\u308a\u30012014 \u5e74\u306e RFC7231 \u306b\u3066 302 Found \u3082 301 Moved Permanently \u3068\u540c\u69d8\u306b POST \u304b\u3089 GET \u3078\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u30e1\u30bd\u30c3\u30c9\u5909\u66f4\u304c\u8a31\u5bb9\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n 302 Found \u3068 307 Temporary Redirect \u306e\u5f79\u5272\u306e\u9055\u3044\u306f\u660e\u78ba\u3067\u3001\u4e00\u6642\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306b\u5bfe\u3057\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u30e1\u30bd\u30c3\u30c9\u5909\u66f4\u3092\u8a31\u5bb9\u3059\u308b\u304b\u5426\u304b\u3067\u3059\u3002<\/p>\n 303 See Other \u306b\u3064\u3044\u3066\u306f\u3001RFC7231 \u5185\u306b\u3053\u3046\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n 6.4.4. 303 See Other (RFC7231)<\/a><\/p>\n The 303 (See Other) status code indicates that the server is redirecting the user agent to a different resource, as indicated by a URI in the Location header field, which is intended to provide an indirect response to the original request.<\/p><\/blockquote>\n \u3053\u3053\u3067\u6ce8\u76ee\u3057\u305f\u3044\u306e\u306f\u3001303 See Other \u304c\u3001302 Moved Temporarily \u304b\u3089\u5206\u96e2\u3055\u308c\u305f\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u3067\u3042\u308b\u306b\u3082\u95a2\u308f\u3089\u305a\u3001\u5b9a\u7fa9\u6587\u304b\u3089 \"temporarily\" \u3068\u3044\u3046\u5358\u8a9e\u304c\u6d88\u3048\u3066\u3044\u308b\u3053\u3068\u3067\u3059\u3002303 See Other \u306f\u4e00\u6642\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3092\u6271\u3046\u3082\u306e\u3067\u306f\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002\u6bd4\u8f03\u306e\u305f\u3081\u3001302 Found \u3068 307 Temporary Redirect \u306e\u5b9a\u7fa9\u6587\u3092\u5f15\u7528\u3057\u307e\u3059\u304c\u3001\u6b21\u306e\u901a\u308a \"temporarily\" \u3068\u3044\u3046\u5358\u8a9e\u304c\u4f7f\u308f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n 6.4.3. 302 Found (RFC7231)<\/a><\/p>\n The 302 (Found) status code indicates that the target resource resides temporarily<\/strong> under a different URI.<\/p><\/blockquote>\n 6.4.7. 307 Temporary Redirect (RFC7231)<\/a><\/p>\n The 307 (Temporary Redirect) status code indicates that the target resource resides temporarily<\/strong> under a different URI and the user agent MUST NOT change the request method if it performs an automatic redirection to that URI.<\/p><\/blockquote>\n \u66f4\u306b\u3001303 See Other \u306b\u3064\u3044\u3066\u306f RFC2616, RFC7231 \u306b\u6b21\u306e\u3088\u3046\u306a\u8a18\u8f09\u3082\u3042\u308a\u3001\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u6642\u306b GET \u3084 HEAD \u3092\u4f7f\u3046\u3053\u3068\u304c\u60f3\u5b9a\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3082\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n 10.3.4 303 See Other (RFC2616)<\/a><\/p>\n The response to the request can be found under a different URI and SHOULD be retrieved using a GET method on that resource.<\/p><\/blockquote>\n 6.4.4. 303 See Other (RFC7231)<\/a><\/p>\n A user agent can perform a retrieval request targeting that URI (a GET or HEAD request if using HTTP), which might also be redirected, and present the eventual result as an answer to the original request.<\/p><\/blockquote>\n \u3053\u308c\u3089\u306e\u5185\u5bb9\u304b\u3089\u3001303 See Other, 307 Temporary Redirect \u304c\u8ffd\u52a0\u3055\u308c\u308b\u524d\u306e 302 Moved Temporarily \u306e\u5229\u7528\u5b9f\u614b\u306f\u6b21\u306e\u3088\u3046\u306a\u3082\u306e\u3060\u3063\u305f\u3068\u8003\u3048\u3089\u308c\u307e\u3059\u3002<\/p>\n 1 \u306e\u7528\u9014\u3092\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u6642\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u30e1\u30bd\u30c3\u30c9\u306e\u5909\u66f4\u53ef\u5426\u3067\u5206\u3051\u305f\u306e\u304c 302 Found \u3068 307 Temporary Redirect \u3067\u3042\u308a\u30012 \u306e\u3088\u3046\u306a\u7528\u9014\u304c 303 See Other \u3067\u3059\u3002<\/p>\n \u4f8b\u3048\u3070\u30d5\u30a9\u30fc\u30e0\u9001\u4fe1\u5f8c\u3001\u5b8c\u4e86\u30da\u30fc\u30b8\u3078\u306f GET \u3067\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\u3088\u3046\u306a\u30b1\u30fc\u30b9\u304c 303 See Other \u3067\u3059\u3002\u4ed6\u306b\u3082 GET \u3067\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u6642\u306b\u30b5\u30fc\u30d0\u30fc\u5074\u3067\u30e6\u30fc\u30b6\u30fc\u306e\u30ed\u30b1\u30fc\u30eb\u3092\u5224\u5b9a\u3057\u3001\u30ed\u30b1\u30fc\u30eb\u306b\u3042\u3063\u305f\u8a00\u8a9e\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u3042\u308b URI \u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\u3088\u3046\u306a\u30b1\u30fc\u30b9\u3082\u305d\u3046\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n \u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u5225\u306e\u7279\u5fb4\u306b\u3064\u3044\u3066\u306f\u3001\u82f1\u8a9e\u7248 Wikipedia \u306e URL redirection<\/a> \u30da\u30fc\u30b8\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b Redirect status codes and characteristics<\/a> \u304c\u308f\u304b\u308a\u3084\u3059\u3044\u306e\u3067\u3001\u305d\u3061\u3089\u3092\u53c2\u8003\u306b\u672c\u8a18\u4e8b\u3092\u307e\u3068\u3081\u308b\u3068\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\u4e00\u6642\u30ea\u30c0\u30a4\u30ec\u30af\u30c8<\/h2>\n
303 See Other \u3068\u306f\u4f55\u306a\u306e\u304b<\/h3>\n
\n
\u307e\u3068\u3081<\/h2>\n