<?xml version='1.0'?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt'?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc rfcedstyle="yes"?>
<!-- BELOW YOU MAY NEED TO MODIFY THE ATTRIBUTE; IF NOT SURE CONSULT WITH THE MAILING LIST-->
<rfc docName="draft-ohye-canonical-link-relation-05" category="info" ipr="trust200902">
  <front>
    <title>The Canonical Link Relation</title>
    <author fullname="Maile Ohye" surname="Ohye" initials="M.">
      <address>
        <email>maileohye@gmail.com</email>
        <uri>http://maileohye.com/</uri>
      </address>
    </author>
    <author fullname="Joachim Kupke" surname="Kupke" initials="J.">
      <address>
        <email>joachim@kupke.za.net</email>
      </address>
    </author>
    <date year="2012" month="March"/>
    <abstract>
      <t>RFC5988 specified a way to define relationships between links on the web. This document describes a new type of such relationship, "canonical", to designate an IRI as preferred over resources with duplicative content.</t>
    </abstract>
    <note title="Editorial Note (To be removed by RFC Editor)">
    <t>Distribution of this document is unlimited. Comments should be sent to the IETF Apps-Discuss mailing list (see <eref target="https://www.ietf.org/mailman/listinfo/apps-discuss"/>).</t> 
    </note>
  </front>
  <middle>
    <section title="Introduction">
      <t>The canonical link relation specifies the preferred IRI from resources with duplicative content. Common implementations of the canonical link relation are to specify the preferred version of an IRI from duplicate pages created with the addition of IRI parameters (e.g., session IDs), or to specify the single-page version as preferred over the same content separated on multiple component pages.</t>
      
      <t>In regard to the link relation type, "canonical" can be described informally as the author's preferred version of a resource. More formally, the canonical link relation specifies the preferred IRI from a set of resources that return the context IRI's content in duplicated form. Once specified, applications such as search engines can focus processing on the canonical, and references to the context (referring) IRI can be updated to reference the target (canonical) IRI.</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="The Canonical Link Relation">
      <t>The target (canonical) IRI MUST identify content that is either duplicative or a superset of the content at the context (referring) IRI. Authors who declare the canonical link relation ought to anticipate that applications such as search engines can:</t>
      
      <t>
        <list style="symbols">
          <t>Index content only from the target IRI (i.e. content from the context IRIs will be likely disregarded as duplicative)</t>
          
          <t>Consolidate IRI properties, such as link popularity, to the target IRI</t>
          
          <t>Display the target IRI as the representative IRI</t>
        </list>
      </t>
      
      <t>The target (canonical) IRI MAY:</t>
      
      <t>
        <list style="symbols">
          <t>Specify a relative IRI (see <xref target="RFC3986" /> Section 4.2)</t>
        
          <t>Be self-referential (context IRI identical to target IRI)</t>
        
          <t>Exist on a different hostname or domain</t>
        
          <t>Have different scheme names, such as "http" to "https," or "gopher" to "ftp"</t>
        
          <t>Be a superset of the content at the context IRI
            <list style="symbols">
              <t>As an example, each component page (e.g., page-1.html, page-2.html) of a multi-page article MAY specify the "view-all" version (e.g., page-all.html), the superset of their content, as the target IRI. This is because the content from each component page is contained within the view-all version. Given this implementation, applications can mark page-1.html and page-2.html as duplicates of page-all.html, process content only from page-all.html, and disregard the component pages. All references can then be made to the view-all version (page-all.html, the target IRI), and no content will have been lost in this process.</t> 
              
              <t>Using the same example above, page-2.html SHOULD NOT designate page-1.html as the target (canonical) IRI because this may cause a loss of data. When page-2.html desginates page-1.html as the canonical, only content from the target IRI, page-1.html, will be processed. page-2.html may be marked as a duplicate of page-1.html and its content disregarded.</t>
  	        </list>
  	      </t>
  	      
  	      <t>Be the source IRI of a temporary redirect. For HTTP, this refers to status codes 302, 303, or 307 (Sections 10.3.3, 10.3.4, and 10.3.8, respectively, of <xref target="RFC2616"/>).</t>
  	    </list>
  	  </t>
  	  
  	  <t>To better ensure that applications properly handle the canonical link relation, administrators ought to consider the following guidelines:</t>
  	  <t>
  	    <list style="symbols">
  	      <t>Specify only one canonical link relation for a resource. (It would be confusing to consider/label/designate more than one IRI as authoritative.)</t>
  	    
  	      <t>Avoid desginating the target (canonical) as:</t>
  	      
  	        <list style="symbols">
  	          <t>The source IRI of a permanent redirect (for HTTP, this refers to 300 and 301 response codes, defined in Sections 10.3.1 and 10.3.2 of <xref target="RFC2616"/>)</t>
  	      
  	          <t>An IRI that also specifies a canonical link relation to an IRI other than itself</t>
  	      
  	          <t>An IRI that returns an error code, such as 4xx response in HTTP (Section 10.4 of <xref target="RFC2616"/>)</t>
  	      
  	          <t>The first page of a multi-page article or multi-page listing of items (since the first page is not duplicative or a superset of the context IRI). For example, page-2.html and page-3.html of an article SHOULD NOT specify page-1.html as the canonical. This may cause a loss of data from page-2.html and page-3.html as they will be marked duplicative of page-1.html with only content from page-1.html being processed.</t>
  	        </list>  
  	        
  	    </list>
  	  </t>
  	   
  	  <t>When the canonical link relation is declared improperly, such as creating chained canonicals (i.e., target IRI specifies the source IRI of a permanent redirect) or designating a target IRI which returns a 4xx response, applications can use their own heuristics when processing the resource. For instance, an application can choose to ignore any improper canonical designation and continue to process the remaining content on a page.</t>
  	    	  
    </section>
    
    <section title="Examples">
    
      <t>The following example illustrates:</t>
      <t>
        <list style="symbols">
          <t>Three IRIs that serve duplicate content</t>
        
          <t>One IRI which is the canonical or "preferred version"</t>
        
          <t>Two IRIs with additional query parameters, making them the non-preferred version of the content (duplicates). The canonical link relation is therefore specified on these duplicates.</t>
        </list>
      </t>
    
      <t>If the preferred version of a IRI and its content exists at:</t>
      
      <figure>
        <artwork type="example">http://www.example.com/page.php?item=purse</artwork>
      </figure>
      
      <t>Then duplicate content IRIs such as:</t>
    
      <figure>
        <artwork type="example">http://www.example.com/page.php?item=purse&amp;category=bags</artwork>
      </figure>
    
      <figure>
        <artwork type="example">http://www.example.com/page.php?item=purse&amp;category=bags&amp;sid=1234</artwork>
      </figure>
    
      <t>may designate the canonical link relation in HTML as specified in <xref target="REC-html401-19991224"/>:</t>
    
      <figure>
        <artwork type="example">&lt;link rel="canonical"
        href="http://www.example.com/page.php?item=purse"&gt;</artwork>
      </figure>
    
      <t>or as a relative IRI:</t>
    
      <figure>
        <artwork type="example">&lt;link rel="canonical" href="page.php?item=purse"&gt;</artwork>
      </figure>
    
      <t>or alternatively, in the HTTP header field as specified in Section 5 of <xref target="RFC5988"/>:</t>
    
      <figure>
        <artwork type="example">Link: &lt;http://www.example.com/page.php?item=purse&gt;; rel="canonical"</artwork>
      </figure>
    
      <t>This signals to applications, such as search engines, that these are duplicates of the target (canonical) IRI:
      http://www.example.com/page.php?item=purse.</t>
  
      <t>Applications may then select the canonical value as the display IRI (such as in search results), and additional IRI properties such as indexing and ranking signals, can be transferred as well.</t>
  
    </section>

    <section title="Recommendations">
    
      <t>Before adding the canonical link relation, verification of the following is RECOMMENDED:</t>
    
      <t>
        <list style="numbers">
          <t>The content of the context IRI is duplicated within the content of the target (canonical) IRI.</t>
          
          <t>For HTTP, Permanent HTTP redirects (Section 10.3.2 of <xref target="RFC2616"/>), the traditional strong indicator that a IRI's content has been permanently moved, could not be implemented in place of the canonical link relation.</t>
          
          <t>In the case where the target (canonical) IRI is a superset of content from the context IRI (i.e., the case where page-1.html and page-2.html designate page-all.html as the canonical), that the user experience is strongly taken into consideration, both in regard to possible increased load time and potential complexity in navigation.</t>
        </list>
      </t>
    </section>

    <section title="IANA Considerations">
      
      <t>IANA is asked to register the Canonical Link Relation below as per <xref target="RFC5988"/>.</t>
      
      <t>Relation Name:
        <list>
          <t>CANONICAL</t>
        </list>
      </t>
      <t>Description:
        <list>
          <t>Designates the preferred version of a resource (the IRI and its contents).</t>
        </list>
      </t>
      <t>Reference:
        <list>
          <t>This specification.</t>
        </list>
      </t>
      
      <t>Notes:
        <list>
          <t>None.</t>
        </list>
      </t>
      
      <t>Application Data:
        <list>
          <t>None.</t>
        </list>
      </t>
      
    </section>
    
    <section title="Security Considerations">
      
      <t>When a site is compromised, the canonical link relation can be implemented with malicious intent to designate the attacker's IRI as the preferred version of the content. While this technique is largely unnoticeable to humans, automated programs may cluster the compromised resource as duplicative of the attacker's target IRI, transferring properties such as link popularity away from the compromised resource to the attacker's designated canonical. (Naturally, even a site that is not compromised could provide inaccurate or misleading information about which URI is canonical.)</t>
    
    </section>
    
    <section title="Internationalisation Considerations">
      
      <t>In designating a canonical IRI, please see section 8 of <xref target="RFC5988" /> for information on URI encoding.</t>
      
    </section>
  
  </middle>
  
  <back>
    <references title="Normative References">
    
      <reference anchor='REC-html401-19991224' target='http://www.w3.org/TR/1999/REC-html401-19991224'>
        <front>
          <title>HTML 4.01 Specification</title>
          <author fullname='Arnaud Le Hors' surname='Le Hors' initials='A.'/>
          <author fullname='David Raggett' surname='Raggett' initials='D.'/>
          <author fullname='Ian Jacobs' surname='Jacobs' initials='I.'/>
          <date year='1999' month='December' day='24'/>
        </front>
        <seriesInfo name='W3C Recommendation' value='REC-html401-19991224'/>
        <annotation>Latest version available at <eref target='http://www.w3.org/TR/html401'/>.</annotation>
      </reference>
      
      <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 at harvard.edu</email>
            </address>
          </author>
          <date month="March" year="1997"/>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
      </reference>
      
      <reference anchor="RFC2616">
        <front>
          <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
          <author initials="R." surname="Fielding" fullname="R. Fielding">
            <organization>University of California, Irvine</organization>
            <address>
              <email>fielding@ics.uci.edu</email>
            </address>
          </author>
          
          <author initials="J." surname="Gettys" fullname="J. Gettys">
            <organization>W3C</organization>
            <address>
              <email>jg@w3.org</email>
            </address>
          </author>
          
          <author initials="J." surname="Mogul" fullname="J. Mogul">
            <organization>Compaq Computer Corporation</organization>
            <address>
              <email>mogul@wrl.dec.com</email>
            </address>
          </author>
          
          <author initials="H." surname="Frystyk" fullname="H. Frystyk">
            <organization>MIT Laboratory for Computer Science</organization>
            <address>
              <email>frystyk@w3.org</email>
            </address>
          </author>
          
          <author initials="L." surname="Masinter" fullname="L. Masinter">
            <organization>Xerox Corporation</organization>
            <address>
              <email>masinter@parc.xerox.com</email>
            </address>
          </author>
          
          <author initials="P." surname="Leach" fullname="P. Leach">
            <organization>Microsoft Corporation</organization>
            <address>
              <email>paulle@microsoft.com</email>
            </address>
          </author>
          
          <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
            <organization>W3C</organization>
            <address>
              <email>timbl@w3.org</email>
            </address>
          </author>
          <date month="June" year="1999"/>
        </front>
        <seriesInfo name="RFC" value="2616"/>
      </reference>
      
      <reference anchor="RFC3986">
      
        <front>
          <title abbrev='URI Generic Syntax'>Uniform Resource Identifier (URI): Generic Syntax</title>
          <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>
              <uri>http://www.w3.org/People/Berners-Lee/</uri>
            </address>
          </author>
        
          <author initials='R.' surname='Fielding' fullname='Roy T. Fielding'>
            <organization abbrev="Day Software">Day Software</organization>
            <address>
              <email>fielding@gbiv.com</email>
              <uri>http://roy.gbiv.com/</uri>
            </address>
          </author>
        
          <author initials='L.' surname='Masinter' fullname='Larry Masinter'>
            <organization abbrev="Adobe Systems">Adobe Systems Incorporated</organization>
            <address>
              <email>LMM@acm.org</email>
              <uri>http://larry.masinter.net/</uri>
            </address>
          </author>
          <date month='January' year='2005'></date>
        </front>
        <seriesInfo name="STD" value="66"/>
        <seriesInfo name="RFC" value="3986"/>
      </reference>
      
      <reference anchor="RFC5988">
        <front>
          <title>Web Linking</title>
          <author fullname="Mark Nottingham" initials="M." surname="Nottingham">
            <address>
              <email>mnot at mnot.net</email>
            </address>
          </author>
          <date month="October" year="2010" />
        </front>
        <seriesInfo name="RFC" value="5988"/>
      </reference>
    
    </references>
    
    <section title="Implementations">
    
      <t>Automated programs that implement functionality with regard for the canonical link relation include:</t>
    
      <t>
        <list style="symbols">
          <t>Google, canonical link relation HTML and HTTP header support, within the same domain and across domains:</t>
          <list>
          	<t>
          	  <eref target="http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html" />
          	</t>
          	<t>
          	  <eref target="http://googlewebmastercentral.blogspot.com/2011/06/supporting-relcanonical-http-headers.html" />
          	</t>
          	<t>
          	  <eref target="http://googlewebmastercentral.blogspot.com/2009/12/handling-legitimate-cross-domain.html" />
          	</t>
           </list>
          <t>Yahoo, canonical link relation HTML support within the same domain:</t>
          <list>
            <t>
              <eref target="http://www.ysearchblog.com/2009/02/12/fighting-duplication-adding-more-arrows-to-your-quiver/" />
            </t>
           </list>
          <t>Bing, canonical link relation HTML support within the same domain:</t>
          <list>
            <t>
              <eref target="http://www.bing.com/community/site_blogs/b/webmaster/archive/2009/02/12/partnering-to-help-solve-duplicate-content-issues.aspx" />
            </t>
           </list>
        </list>
      </t>
    </section>
  </back>
</rfc>