Canonical URLs: Another method to avoid duplicate content
The last article was about methods to avoid duplicate contentAs Neri rightly pointed out, I didn't talk about canonical URLs to avoid that problem.
The methods to avoid duplicate content that I spoke about last time are well known methods for quite some time and I did not think it necessary to explain them, but because of the Canonical URL I did want to dedicate an entire article to explain their reason for being and form to function.
The idea behind canonical URLs is quite simple and practical, an "ugly" URL can signal to the search engine that it prefers another URL as its "canonical" location (preferred location).
This is to avoid duplicate content since for example: "http://example.com", "http://www.eexample.com", "http://www.eexample.com/index.html" are different URL with the same content.
Most of the time a search engine understands that in this case the duplicate content is not made with bad intentionsHowever, this can be more complicated with other cases.
If you look at the canonical url of my blog it is: "http://guillermopareja.com", when they write "http://www.guillermopareja.com" they are automatically redirected to the version without "www".
This happens because I add the following line of code in the HEAD:
<link rel="canonical" href="http://guillermopareja.com/" />
Something that we must remember is to maintain our internal structure according to the canonical URL of our home to indicate to the search engine that this is the URL that we want to maintain.
This is simply a suggestion and not a search engine command, If the engine detects that we are trying to manipulate it in any way, it can take the measures it deems necessary.
Now I'm going to translate some questions from the FAQ that Matt Cutts asked about this topic on his blog: Learn About Canonical Link Element in 5 MinutesIt is highly recommended to read their articles on this topic.
Does this work between different domains?
No, canonical URLs only work within the same domain.
Does it work for subdomains?
Yes, you can make your subdomain have the main domain as a canonical URL.
What is the difference with a 301 redirect?
In fact they are VERY similar, only using the it's much easier 🙂
Although it is true that we cannot control how they link us, this does not have as much weight since When evaluating duplicate content on our site, on-page elements have more value.
I hope this article has served to clarify some doubts, any questions can be left in the comments and I will answer them as soon as possible.