<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc subcompact="no"?>
<?rfc rfcedstyle="yes"?>
<?rfc-ext allow-markup-in-artwork="yes" ?>

<!DOCTYPE rfc [
  <!ENTITY MAY "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MAY</bcp14>">
  <!ENTITY MUST "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST</bcp14>">
  <!ENTITY MUST-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST NOT</bcp14>">
  <!ENTITY OPTIONAL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>OPTIONAL</bcp14>">
  <!ENTITY RECOMMENDED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>RECOMMENDED</bcp14>">
  <!ENTITY REQUIRED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>REQUIRED</bcp14>">
  <!ENTITY SHALL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL</bcp14>">
  <!ENTITY SHALL-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL NOT</bcp14>">
  <!ENTITY SHOULD "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD</bcp14>">
  <!ENTITY SHOULD-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD NOT</bcp14>">
]>
<rfc xmlns:x="http://purl.org/net/xml2rfc/ext" xmlns:ed="http://greenbytes.de/2002/rfcedit" ipr="trust200902" docName="draft-reschke-http-status-308-01" category="exp" xml:lang="en">
	<front>
  <title abbrev="HTTP Status Code 308">The Hypertext Transfer Protocol (HTTP) Status Code 308 (Permanent Redirect)</title>
  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke">
    <organization abbrev="greenbytes">greenbytes GmbH</organization>
    <address>
      <postal>
        <street>Hafenweg 16</street>
        <city>Muenster</city><region>NW</region><code>48155</code>
        <country>Germany</country>
      </postal>
      <email>julian.reschke@greenbytes.de</email>	
      <uri>http://greenbytes.de/tech/webdav/</uri>	
    </address>
  </author>

  <date month="January" year="2012" day="4"/>
  
  <keyword>HTTP</keyword>
  <keyword>redirect</keyword>
  <keyword>status code</keyword>

  <abstract>
    <t>
      This document specifies the additional HyperText Transfer Protocol (HTTP)
      Status Codes 308 (Permanent Redirect). 
    </t>
  </abstract>
  

  <note title="Editorial Note (To be removed by RFC Editor before publication)">
    <t>
      Distribution of this document is unlimited. Although this is not a work
      item of the HTTPbis Working Group, comments should be sent to the 
      Hypertext Transfer Protocol (HTTP) mailing list at <eref target="mailto:ietf-http-wg@w3.org">ietf-http-wg@w3.org</eref>,
      which may be joined by sending a message with subject 
      "subscribe" to <eref target="mailto:ietf-http-wg-request@w3.org?subject=subscribe">ietf-http-wg-request@w3.org</eref>.
    </t>
    <t>
      Discussions of the HTTPbis Working Group are archived at
      <eref target="http://lists.w3.org/Archives/Public/ietf-http-wg/"/>.               
    </t> 
    <t>
      XML versions<ed:replace ed:resolves="edit"><ed:del> and</ed:del><ed:ins>,</ed:ins></ed:replace> latest edits<ed:replace ed:resolves="edit"><ed:ins>, and the issues list</ed:ins></ed:replace> for this document
      are available from <eref target="http://greenbytes.de/tech/webdav/#draft-reschke-http-status-code-308"/>.
    </t>
<ed:replace ed:resolves="edit"><ed:ins>
    <t>
      Test cases related to redirection in general and the status code 308
      in particular can be found at <eref target="http://greenbytes.de/tech/tc/httpredirects/#l-308"/>.
    </t>
</ed:ins></ed:replace>
  </note>


  </front>

  <middle>

<ed:issue xmlns="http://www.w3.org/1999/xhtml" name="edit" type="edit" status="open">
  <ed:item entered-by="julian.reschke@greenbytes.de" date="2011-04-15">
    Umbrella issue for editorial fixes/enhancements.
  </ed:item>
</ed:issue>

<ed:issue xmlns="http://www.w3.org/1999/xhtml" name="refresh" type="edit" status="closed">
  <ed:item entered-by="julian.reschke@greenbytes.de" date="2012-01-04">
    Mention "refresh" workaround.
  </ed:item>
  <ed:resolution>Done.</ed:resolution>
</ed:issue>

<section title="Introduction" anchor="introduction">
<t>
  HTTP defines a set of status codes for the purpose of redirecting a request
  to a different URI. The history of these status codes is summarized in
  <xref target="draft-ietf-httpbis-p2-semantics" x:rel='#status.3xx'/>, which
  also classifies the existing status codes into four categories.
</t>
<t>
  The first of these categories contains the status codes 301 (Moved Permanently),
  302 (Found), and 307 (Temporary Redirect), which can be classified as below: 
</t>
<texttable align="left" suppress-title="true">
<ttcol/>
<ttcol>Permanent</ttcol>
<ttcol>Temporary</ttcol>
<c>Allows changing the request method from POST to GET</c>
<c>301</c>
<c>302</c>
<c>Does not allow changing the request method from POST to GET</c>
<c>-</c>
<c>307</c>
</texttable>
<t>
  <xref target="draft-ietf-httpbis-p2-semantics" x:rel='#status.307'/>
  states that HTTP does not define a permanent variant of status code 307;
  this specification adds this status code (<xref target="status.308"/>).
</t>
</section>  

<section title="Notational Conventions">
<t>
   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in <xref target="RFC2119"/>.
</t>
</section>

<section title="308 Permanent Redirect" anchor="status.308">
<t>
  The target 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 effective request URI (<xref target='draft-ietf-httpbis-p1-messaging' x:rel='#effective.request.uri'/>)
  to one or more of the new references returned by the server, where possible.
</t>
<t>
  The permanent URI &SHOULD; be given by the Location field in the response.
  Unless the request method was HEAD, the representation of the response
  &SHOULD; contain a short hypertext note with a hyperlink to the new URI(s),
  since most user agents do not understand the 308 status code yet. Therefore,
  the note &SHOULD; contain the information necessary for a user to repeat
  the original request on the new URI.
</t>
<t>
  If the 308 status code is received in response to a request method that is
  known to be "safe", as defined in <xref target="draft-ietf-httpbis-p2-semantics" x:rel='#safe.methods'/>,
  then the request &MAY; be automatically redirected by the user agent without
  confirmation. Otherwise, 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.
</t>
</section>

<section title="Deployment Considerations">
<t>
  <xref target="draft-ietf-httpbis-p2-semantics" x:rel='#status.code.and.reason.phrase'/>
  requires recipients to treat unknown 3xx status codes the same way as
  status code 300 Multiple Choices (<xref target="draft-ietf-httpbis-p2-semantics" x:rel='#status.300' x:fmt=','/>).
  Thus, servers will not be able to rely on automatic redirection happening
  similar to status codes 301, 302, or 307.
</t>
<t>
  Therefore, initial use of status code 308 will be restricted to cases where
  the server has sufficient confidence in the clients understanding the new 
  code, or a fallback to the semantics of status code 300 is not problematic.
</t>
<ed:replace ed:resolves="refresh" datetime="2012-01-04"><ed:ins><t>
  Note that existing user agents will emulate a refresh when encountering
  an HTML &lt;meta&gt; refresh directive. This can be used as another
  fallback.
</t>
<figure>
  <preamble>For example:</preamble>
  <artwork type="message/http; msgtype=&#34;response&#34;">
HTTP/1.1 308 Permanent Redirect
Content-Type: text/html
Location: http://example.com/new

&lt;html&gt;
   &lt;head&gt;
      &lt;title&gt;Permanent Redirect&lt;/title&gt;
      &lt;meta http-equiv="refresh" 
            content="0; url=http://example.com/new"&gt;
   &lt;/head&gt;
   &lt;body&gt;
      &lt;p&gt;
         The document has been moved to
         &lt;a href="http://example.com/new"&gt;http://example.com/new&lt;/a&gt;.
      &lt;/p&gt;
   &lt;/body&gt;
&lt;/html&gt;
</artwork>
</figure>
</ed:ins></ed:replace>
</section>

<section title="Security Considerations" anchor="security.considerations">
<t>
  All security considerations that apply to HTTP redirects apply to the
  308 status code as well (see <xref target="draft-ietf-httpbis-p2-semantics" x:rel='#security.considerations'/>).
</t>
</section>  

<section title="IANA Considerations" anchor="iana.considerations">
<t>
   The registration below shall be added to the HTTP Status Code Registry
   (defined in <xref target="draft-ietf-httpbis-p2-semantics" x:rel='#status.code.registry'/>
   and located at <eref target="http://www.iana.org/assignments/http-status-codes"/>):
</t>
<texttable align="left" suppress-title="true" anchor="iana.status.code.registration.table">
   <ttcol>Value</ttcol>
   <ttcol>Description</ttcol>
   <ttcol>Reference</ttcol>
   <c>308</c>
   <c>Permanent Redirect</c>
   <c>
      <xref target="status.308"/>
   </c>
</texttable>
</section>

<section title="Acknowledgements">
<t>
  The definition for the new status code 308 re-uses text from
  the HTTP/1.1 definitions of status codes 301 and 307.
</t>
</section>
  </middle>
  <back>
  
<references title="Normative References">

<reference anchor="RFC2119">
  <front>
    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
    <author initials="S." surname="Bradner" fullname="Scott Bradner">
      <organization>Harvard University</organization>
      <address><email>sob@harvard.edu</email></address>
    </author>
    <date month="March" year="1997"/>
  </front>
  <seriesInfo name="BCP" value="14"/>
  <seriesInfo name="RFC" value="2119"/>
</reference>

<reference anchor="draft-ietf-httpbis-p1-messaging">
  <front>
    <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title>
    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
      <address><email>fielding@gbiv.com</email></address>
    </author>
    <author initials="J." surname="Gettys" fullname="Jim Gettys">
      <organization abbrev="Alcatel-Lucent">Alcatel-Lucent Bell Labs</organization>
      <address><email>jg@freedesktop.org</email></address>
    </author>
    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
      <organization abbrev="HP">Hewlett-Packard Company</organization>
      <address><email>JeffMogul@acm.org</email></address>
    </author>
    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
      <organization abbrev="Microsoft">Microsoft Corporation</organization>
      <address><email>henrikn@microsoft.com</email></address>
    </author>
    <author initials="L." surname="Masinter" fullname="Larry Masinter">
      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
      <address><email>LMM@acm.org</email></address>
    </author>
    <author initials="P." surname="Leach" fullname="Paul J. Leach">
      <organization abbrev="Microsoft">Microsoft Corporation</organization>
      <address><email>paulle@microsoft.com</email></address>
    </author>
    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
      <address><email>timbl@w3.org</email></address>
    </author>
    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
      <organization abbrev="W3C">World Wide Web Consortium</organization>
      <address><email>ylafon@w3.org</email></address>
    </author>
    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
      <organization abbrev="greenbytes">greenbytes GmbH</organization>
      <address><email>julian.reschke@greenbytes.de</email></address>
    </author>
    <date month="January" year="2012"/>
  </front>
  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-18"/>
  <x:source href="draft-ietf-httpbis-p1-messaging-18.xml" basename="draft-ietf-httpbis-p1-messaging"/>
</reference>

<reference anchor="draft-ietf-httpbis-p2-semantics">
  <front>
    <title abbrev="HTTP/1.1">HTTP/1.1, part 2: Message Semantics</title>
    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
      <address><email>fielding@gbiv.com</email></address>
    </author>
    <author initials="J." surname="Gettys" fullname="Jim Gettys">
      <organization>One Laptop per Child</organization>
      <address><email>jg@laptop.org</email></address>
    </author>
    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
      <organization abbrev="HP">Hewlett-Packard Company</organization>
      <address><email>JeffMogul@acm.org</email></address>
    </author>
    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
      <organization abbrev="Microsoft">Microsoft Corporation</organization>
      <address><email>henrikn@microsoft.com</email></address>
    </author>
    <author initials="L." surname="Masinter" fullname="Larry Masinter">
      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
      <address><email>LMM@acm.org</email></address>
    </author>
    <author initials="P." surname="Leach" fullname="Paul J. Leach">
      <organization abbrev="Microsoft">Microsoft Corporation</organization>
      <address><email>paulle@microsoft.com</email></address>
    </author>
    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
      <address><email>timbl@w3.org</email></address>
    </author>
    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
      <organization abbrev="W3C">World Wide Web Consortium</organization>
      <address><email>ylafon@w3.org</email></address>
    </author>
    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
      <organization abbrev="greenbytes">greenbytes GmbH</organization>
      <address><email>julian.reschke@greenbytes.de</email></address>
    </author>
    <date month="January" year="2012"/>
  </front>
  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-18"/>
  <x:source href="draft-ietf-httpbis-p2-semantics-18.xml" basename="draft-ietf-httpbis-p2-semantics-18"/>
</reference>
  
</references>

<ed:replace ed:resolves="edit" datetime="2012-01-03"><ed:ins><section title="Implementations (to be removed by RFC Editor before publication)" anchor="implementations">
<t>
  <x:h>Chrome</x:h>: Feature requested in Chromium Issue 109012 (<eref target="http://code.google.com/p/chromium/issues/detail?id=109012"/>).
</t>
<t>
  <x:h>Firefox</x:h>: Feature requested in Bugzilla bug 714302 (<eref target="https://bugzilla.mozilla.org/show_bug.cgi?id=714302"/>), patch available.
</t>
<t>
  <x:h>Safari</x:h>: Safari automatically redirects 3xx status codes when a Location header field is present, thus no change is needed.
</t>
</section></ed:ins></ed:replace>

<ed:replace ed:resolves="edit" datetime="2012-01-03"><ed:ins><section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
<section title="Since draft-reschke-http-status-308-00">
<t>
  Updated HTTPbis reference. Added <xref target="implementations"/>.
  Added an resolved issue "<ed:issueref>refresh</ed:issueref>".
</t>
</section>
</section></ed:ins></ed:replace>
  </back>

</rfc>