Share via:

Canonical URL

A simple guide to using the Canonical URL tag, and tips on avoiding duplicated content in the SERPs.

728 views

Edited: 2019-09-30 01:51

The rel=Canonical URL allows you to tell search engines that duplicated content available on other URLs are actually the same content as that available on the Canonical URL.

When servers are configured incorrectly, or CMS systems are designed with little forethought, content may sometimes become available on multiple URLs. A common situation where this may occur, is when using the WWW subdomain. Another is when the index file (I.e. index.html), is accessible both from http://beamtic.com/index.html and http://beamtic.com/.

A simple way to solve this problem is to simply block requests for the index file, or redirect them to the bare domain. Another, less desirable solution, is to use the link tag with the rel=canonical attribute set. The tag can be included in all versions of the page.

<link rel="canonical" href="http://example.com/">

If you are using PHP, and you want to prevent access for non-existent URL paramerters (query strings), you should see this article: Blocking Out Non-Existent URL Parameters

Canonical URL Tag

Sometimes you might not be able to configure the server properly, for whatever reason – usually due to host specific limits. In those cases, you may want to include a Canonical URL Tag, which tells the search engines which URL you want to show up in the SERPs.

Including the below code in your head section, would suggest that only http://beamtic.com/ be used – just replace beamtic with your own domain name.

<link rel="canonical" href="http://example.com/">

SEO Benefits

Generally, there are no SEO benefits unless you are already having problems with unwanted URLs in search engines. If you can not fix the problem with your site, then you may want to still use canonicals, as it could help you avoid potential problems.

Canonical URL vs 301 Redirect

It is actually best to avoid both redirects and canonicals. The best thing to do, is always to configure your server and CMS correctly from the start, as it avoids all of these issues with duplicated content.

Even when the damage is already done, it may sometimes be best to just throw a 404 error on the old duplicate URLs, rather than spending time redirecting each and every page. If you have a lot of incoming traffic from those old moved URLs, you could consider if it would be worth the effort to also redirect them.

Please also note, someone with technical skills will generally be able to redirect old URLs without major problems. This sometimes might depend on the CMS and server you are using, but modern CMS should offer this capability. In general, it should not take longer than a few minutes or a small hour to redirect even hundreds of pages. Rather than using the build-in tools in your CMS, it may sometimes be more reliable to have a list of URLs to redirect, and then include it directly in your server configuration (Apache makes this very easy). Note. This does require some basic knowledge of servers, but again, I think it is highly worth it. Someone who is knowledgeable in this area will often be able to automate the task via scripts.

There is a lot of disagreement about redirecting and use of canonical, but the technical side of things are clear. The standards are clear. It makes no semantic sense to redirect a page that has been deleted, and also, having a lot of duplicated pages is simply extremely unprofessional. It should not happen in a proper configuration. I am afraid, if you do have problems in this area, you might have many other issues with your website as well, including security.

See also

  1. Trailing slashes in URLs

Comments