This
class of status code indicates that further action needs to be taken by the
user agent in order to fulfill the request. The action required may be carried
out by the user agent without interaction with the user if and only if the
method used in the second request is get or head. A client should detect
infinite redirection loops, since such loops generate network traffic for each
redirection.
Note: previous versions of this specification
recommended a
maximum of five redirections. Content
developers should be aware
that there might be clients that
implement such a fixed
limitation.
Multiple
Choices: Code 300
The
requested resource corresponds to any one of a set of representations, each with
its own specific location, and agent- driven negotiation information (section
12) is being provided so that the user (or user agent) can select a preferred
representation and redirect its request to that location.
Unless
it was a head request, the response should include an entity containing a list
of resource characteristics and location(s) from which the user or user agent
can choose the one most appropriate. The entity format is specified by the
media type given in the Content- Type header field. Depending upon the format
and the capabilities of the user agent, selection of the most appropriate
choice may be performed automatically. However, this specification does not
define any standard for such automatic selection.
If
the server has a preferred choice of representation, it should include the
specific URI for that representation in the Location field; user agents may use
the Location field value for automatic redirection. This response is cacheable
unless indicated otherwise.
Moved
Permanently: Code 301
The
requested resource has been assigned a new permanent URI and any future
references to this resource should use one of the returned URIs. Clients with
link editing capabilities ought to automatically re-link references to the
Request-URI to one or more of the new references returned by the server, where
possible. This response is cacheable unless indicated otherwise.
The
new permanent URI should be given by the Location field in the response. Unless
the request method was head, the entity of the response should contain a short
hypertext note with a hyperlink to the new URI(s).
If
the 301 status code is received in response to a request other than get or head,
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.
Note: When automatically redirecting a post
request after
receiving a 301 status code, some
existing HTTP/1.0 user agents
will erroneously change it into a get
request.
Found:
Code 302
The
requested resource resides temporarily under a different URI. Since the
redirection might be altered on occasion, the client should continue to use the
Request-URI for future requests. This response is only cacheable if indicated
by a Cache-Control or Expires header field.
The
temporary URI should be given by the Location field in the response. Unless the
request method was head, the entity of the response should contain a short
hypertext note with a hyperlink to the new URI(s).
If
the 302 status code is received in response to a request other than get or head,
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.
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.
See
Other: Code 303
The
response to the request can be found under a different URI and should be
retrieved using a GET method on that resource. This method exists primarily to
allow the output of a POST-activated script to redirect the user agent to a
selected resource. The new URI is not a substitute reference for the originally
requested resource. The 303 response must not be cached, but the response to
the second (redirected) request might be cacheable.
The
different URI should be given by the Location field in the response. Unless the
request method was head, the entity of the response should contain a short
hypertext note with a hyperlink to the new URI(s).
Note: Many pre-HTTP/1.1 user agents do not
understand the 303
status. When interoperability with such clients
is a concern, the
302 status code may be used instead,
since most user agents react
to a 302 response as described here for
303.
Not
Modified: Code 304
If
the client has performed a conditional GET request and access is allowed, but
the document has not been modified, the server should respond with this status
code. The 304 response MUST NOT contain a message-body, and thus is always
terminated by the first empty line after the header fields.
Use
Proxy: Code 305
The
requested resource MUST be accessed through the proxy given by the Location
field. The Location field gives the URI of the proxy. The recipient is expected
to repeat this single request via the proxy. 305 responses MUST only be generated
by origin servers.
Note: RFC 2068 was not clear that 305 was
intended to redirect a
single request, and to be generated by
origin servers only. Not
observing these limitations has
significant security consequences.
Temporary
Redirect: Code 307
The
requested resource resides temporarily under a different URI. Since the
redirection may be altered on occasion, the client should continue to use the
Request-URI for future requests. This response is only cacheable if indicated
by a Cache-Control or Expires header field.
The
temporary URI should be given by the Location field in the response. Unless the
request method was HEAD, the entity of the response should contain a short
hypertext note with a hyperlink to the new URI(s) , since many pre-HTTP/1.1 user
agents do not understand the 307 status. Therefore, the note should contain the
information necessary for a user to repeat the original request on the new URI.
If
the 307 status code is received in response to a request other than GET or
HEAD, 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.
No comments:
Post a Comment