<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cordobo &#187; canonical-urls</title>
	<atom:link href="http://cordobo.com/tag/canonical-urls/feed/" rel="self" type="application/rss+xml" />
	<link>http://cordobo.com</link>
	<description>Weblog of Andreas Jacob on Webdesign and CSS</description>
	<lastBuildDate>Mon, 20 Feb 2012 09:57:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Canonical URL&#8217;s, Optimized Permalinks</title>
		<link>http://cordobo.com/1043-canonical-urls-optimized-permalinks/</link>
		<comments>http://cordobo.com/1043-canonical-urls-optimized-permalinks/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 22:05:11 +0000</pubDate>
		<dc:creator>Andreas Jacob</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[canonical-url]]></category>
		<category><![CDATA[canonical-urls]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[pages]]></category>
		<category><![CDATA[permalink]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://cordobo.com/?p=1043</guid>
		<description><![CDATA[I updated my WordPress permalinks from an old-fashioned and quite outdated /%year%/%monthnum%/%day%/%postname%/ to the more optimized structure /%post_id%-%postname%/. Although I still like it if I can see the date and the entry title at a glance, the new structure has two advantages: the new permalink structure is in some cases faster because of the way [...]]]></description>
			<content:encoded><![CDATA[<p>I updated my WordPress permalinks from an old-fashioned and quite outdated <code>/%year%/%monthnum%/%day%/%postname%/</code> to the more optimized structure <code>/%post_id%-%postname%/</code>. Although I still like it if I can see the date and the entry title at a glance, the new structure has two advantages:</p>
<ol>
<li>the new permalink structure is in some cases faster because of the way wordpress stores the URL information in the database (see further: <em><a href="http://dougal.gunters.org/blog/2009/02/04/efficient-wordpress-permalinks">Efficient permalink strategies for WordPress</a></em>)</li>
<li>according to SEO&#8217;s, a link like <a href="http://cordobo.com/540-firefox-add-ons-for-developers/">cordobo.com/540-firefox-add-ons-for-developers/</a> is more likely to result in a better <abbr title="Search engine results page">SERP</abbr> position than (the same) link named <a href="http://cordobo.com/2008/09/30/firefox-add-ons-for-developers/">cordobo.com/2008/09/30/firefox-add-ons-for-developers/</a></li>
</ol>
<p><span id="more-1043"></span></p>
<h3>Migrating old permalinks to a new structure</h3>
<p>To avoid duplicate content and <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">404 &#8211; Not found</a> errors, you should redirect visitors and web crawlers (like GoogleBot) to the new URL with the HTTP Status Code <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2">301 &#8211; Moved Permanently</a>.</p>
<p>The fastest way to migrate your old permalinks to the new structure is <a href="http://www.deanlee.cn/wordpress/permalinks-migration-plugin/">Dean&#8217;s Permalinks Migration</a> plugin. It&#8217;s from 2006, but it works great with WordPress 2.7.1. After uploading the plugin, activate it and enter your actual permalink structure (the old one), e.g. <code>/%year%/%monthnum%/%day%/%postname%/</code> on the plugin&#8217;s options page and save it. Now you have done that, change the &#8220;Permalink Settings&#8221; to the new structure, in my case <code>/%post_id%-%postname%/</code>.</p>
<h3>Canonical URLs for comments pages</h3>
<p>I really like WordPress new way to break comments into various pages, because paginated comments can reduce your traffic and save your visitors browser (or RAM) resources. But on pages with a lot of comments, it can create a lot of duplicate content, like it happened here:</p>
<ul>
<li>http://cordobo.com/224-updateupgrade-to-wp-21/</li>
<li>http://cordobo.com/224-updateupgrade-to-wp-21/comment-page-6/</li>
<li>http://cordobo.com/224-updateupgrade-to-wp-21/comment-page-5/</li>
<li>&hellip;</li>
</ul>
<p>A consortium of leading web companies, including Google, Yahoo! and Microsoft, created a new standard to handle this kind of unintended duplicate content &ndash; <strong>Canonical URLs</strong>.</p>
<blockquote><p>Q: What is a canonical url? Do you have to use such a weird word, anyway?<br />
A: [...] Canonicalization is the process of picking the best url when there are several choices, and it usually refers to home pages. For example, most people would consider these the same urls:</p>
<p>    * www.example.com<br />
    * example.com/<br />
    * www.example.com/index.html<br />
    * example.com/home.asp</p>
<p><strong>But technically all of these urls are different</strong>. A web server could return completely different content for all the urls above. When Google &#8220;canonicalizes&#8221; a url, we try to pick the url that seems like the best representative from that set.</p></blockquote>
<p>Quoted from Matt Cutts, <a href="http://www.mattcutts.com/blog/seo-advice-url-canonicalization/">SEO advice: url canonicalization</a></p>
<p>They came up with a simple solution, a reference in the &lt;head&gt; of the page to the preferred URL:<br />
<code>&lt;link rel="canonical" href="http://cordobo.com/224-updateupgrade-to-wp-21/" /&gt;</code></p>
<p>To apply this link automatically to every page with comments, I added some lines of code to the <code>functions.php</code> file of my theme. Steve came up with a simple solution in his article  <a href="http://ilikewordpress.com/181/dealing-with-duplicate-content-issues-on-wordpress-comments-pages/">Dealing With Duplicate Content Issues on WordPress Comments Pages</a>:</p>
<p><code> function canonical_for_comments() {<br />
  global $cpage, $post;<br />
  if ( $cpage &gt; 1 ) :<br />
    echo &#34;\n&#34;;<br />
    echo &#34;&lt;link rel=&#39;canonical&#39; href=&#39;&#34;;<br />
    echo get_permalink( $post-&gt;ID );<br />
    echo &#34;&#39; /&gt;\n&#34;;<br />
 endif;<br />
}<br />
add_action( &#39;wp_head&#39;, &#39;canonical_for_comments&#39; );</code></p>
<p>If you use a plugin like <a href="http://wordpress.org/extend/plugins/all-in-one-seo-pack/">All-In-One-SEO</a> or Yoasts <a href="http://yoast.com/wordpress/canonical/">Canonical URL&#8217;s for WordPress</a>, you don&#8217;t have to worry about it &ndash; both already take care about canonical URLs.</p>
<p>If you want to know more about duplicate content and how to avoid it using canonical URLs, watch Matt Cutts video or <a href="http://docs.google.com/Present?docid=ddvhbrqf_70dp3rv7hn">check the presentation</a> he did at SMX West:</p>
<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/Cm9onOGTgeM&#038;hl=de&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Cm9onOGTgeM&#038;hl=de&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://cordobo.com/1043-canonical-urls-optimized-permalinks/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

