
Ask HN: What is the correct version of “canonical” tag? - maxraz
Could you tell the correct version of the rarely used &quot;canonical&quot; tag, please<p>&lt;link rel=&quot;canonical&quot; href=&quot;http:&#x2F;&#x2F;mysite.com&quot; &#x2F;&gt;<p>VS<p>&lt;link rel=&quot;canonical&quot; href=&quot;http:&#x2F;&#x2F;mysite.com&quot;&gt;<p>Thanks.
======
sjs382
For a XHTML doctype, you use the first one.

For a HTML4 doctype, you use the second.

For a HTML5 doctype, you can use either.

~~~
maxraz
Thank you for spending your time to help me, Sir.

