TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What is the correct version of “canonical” tag?

1 pointsby maxrazover 7 years ago
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.

1 comment

sjs382over 7 years ago
For a XHTML doctype, you use the first one.<p>For a HTML4 doctype, you use the second.<p>For a HTML5 doctype, you can use either.
评论 #15074314 未加载