<p dir="auto">I'm fairly often finding old versions of Rust docs from other sites when I Google things. For instance, searching for 'rust macro_rules' finds me <a href="http://web.mit.edu/rust-lang_v0.9/doc/guide-macros.html" rel="nofollow">http://web.mit.edu/rust-lang_v0.9/doc/guide-macros.html</a> (as the second result, after the <a href="http://rustbyexample.com/staging/macros.html" rel="nofollow">Rust by Example page</a>), and the rust-lang.org page is nowhere to be found. Googling 'ContravariantLifetime' finds me <a href="http://www.contrib.andrew.cmu.edu/~acrichto/doc/std/kinds/marker/struct.ContravariantLifetime.html" rel="nofollow">http://www.contrib.andrew.cmu.edu/~acrichto/doc/std/kinds/marker/struct.ContravariantLifetime.html</a> .</p>
<p dir="auto">One way to avoid this going forward would be for the documentation included in release tarballs to use a <code class="notranslate">&lt;link rel="canonical"&gt;</code> tag pointing to the corresponding doc.rust-lang.org URL for that documentation page. This would allow the pages to be viewed directly without redirects (preserving local use), but any search engine juice would be repointed at the official URL.</p>
<p dir="auto">See the following pages for discussion on canonical links:</p>
<ul dir="auto">
<li><a href="https://support.google.com/webmasters/answer/139066#2" rel="nofollow">https://support.google.com/webmasters/answer/139066#2</a></li>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/www_and_non-www_URLs#Using_link_with_the_attirbute_rel.3D.22canonical.22" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/HTTP/www_and_non-www_URLs#Using_link_with_the_attirbute_rel.3D.22canonical.22</a></li>
<li><a href="https://www.mattcutts.com/blog/canonical-link-tag/" rel="nofollow">https://www.mattcutts.com/blog/canonical-link-tag/</a></li>
<li><a href="http://moz.com/blog/complete-guide-to-rel-canonical-how-to-and-why-not" rel="nofollow">http://moz.com/blog/complete-guide-to-rel-canonical-how-to-and-why-not</a></li>
</ul>
<p dir="auto">The other option would be to include <code class="notranslate">&lt;meta name="robots" content="noindex"&gt;</code> in the documentation in tarballs, which would completely prevent them from getting indexed. This tag would of course need to not be in the doc.rust-lang.org version; I don't know if this would be difficult.</p>
<p dir="auto">I could probably create a PR if that would be helpful, but I'm not at all familiar with the doc generation and release tarball creation process.</p>
<p dir="auto">When multiple versions of the documentation are available, it tends to pollute google results. As a way to prevent that, it would be good to always have the latest stable release available under /current/, and have all previous versions + the master docs contain canonical links to the current docs like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;link rel=&quot;canonical&quot; href=&quot;http://.../current/...&quot; /&gt;"><pre class="notranslate"><code class="notranslate">&lt;link rel="canonical" href="http://.../current/..." /&gt;
</code></pre></div>
<p dir="auto">That way it consolidates all results under the current URL which will always be correct, and it also encourages people linking to docs in blog posts and such to use links that will not rot.</p>
<p dir="auto">/cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/alexcrichton/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/alexcrichton">@alexcrichton</a></p>