What is a Canonical URL?
You can think of the word canonical as it relates to URLs as meaning “official”. That is what someone is talking about when they are referring to a canonical URL. They are actually referring to the official and permanent location of a resource.
As described in the article, “What is a URL Address and How do they Work?”, particularly the example where I am referring to different protocols (http vs https) and optional parts of the URL like the subdomain (www) and the port (:443) is relevant to this topic.
There are often many different ways to get to the same place. For example:
- http://BuzzyPlanet.com/ what-are-canonical-urls
Those are all examples that will ultimately get you to the same place. But they are actually very different URL’s. In fact, if I wanted to, I could technically provide a different set of information at every single one of those addresses, even though they are all essentially the same.
A canonical URL is the “preferred” URL, or as I said before, the official URL where a particular resource is permanently stored for retrieval by whoever is authorized to access it.
So, if my preferred URL is https://BuzzyPlanet.com/what-are-canonical-urls (and it is by the way), then I would want all those other possibilities to lead to the exact same place.
I don’t want to create duplicates, I want to “redirect” or “alias” those other links to the actual link.
Another example would be that I may have some kind of mirror, or perhaps I want to publish this text that you are reading somewhere else.
In that case, I would link back to the original by “citing” the canonical URL indicating to you (the reader), and perhaps more importantly (from a ranking perspective) to search engines, that the article is the same as, and is sourced from, this page.
Another way to ask this would be, “How do I make sure Google and other search engines know which URL to a page is the URL that I want to be the official or canonical URL?”
Always Link to Pages in the Same Way
If your domain is like BuzzyMarketing.com and does not use the “www” or some other sub-domain, then always link using just the domain. If you mix things up and sometimes link to BuzzyMarketing.com and other times link to www.BuzzyMarketing.com then search engines could get confused.
From an SEO perspective, this means that search engines could penalize you (whether explicitly or accidentally) for having duplicate content.
How Can I Ensure Against Human Error?
You can use redirects to your server. For example, in IIS there is a rewrite module, and in Linux, there is the .htaccess file.
You can use these two systems to always do a 301 redirect to the preferred source. Explaining how to do this is beyond the scope of this article, but you can get some information about it here for Linux and here for IIS.
This much I will tell you, always do a 301 redirect instead of a 302 or 307 for these types of redirects because that way the “link juice” will flow and coalesce to the target page.
When You Move, a Page Make Sure to Redirect
If you move a page to another location, or even if you just change the filename of the page, if that page has been published for any length of time, you’ll want to make sure and redirect the old URL to the new page.
Doing this makes sure that any links that were created elsewhere end up returning your page, and any benefits that the original page had with regard to search engines will be passed onto the new or renamed page.
For more information about canonical URLs see the Wikipedia page.
Still Have Questions about Canonical URLs?
If you have any questions about Canonical URLs or you just want to say hello, leave me a comment using the form below. I always respond!
In fact, if you have your very own canonical URL, you can leave it using the form in the field labeled “Website:” in the form.
If you don’t have your own website, I encourage you to get your own website here in less than five minutes (for FREE)!
Then you’ll have your very own set of canonical links!