What Is Canonical And How To Fix It

A canonical tag is an HTML element that helps webmasters prevent duplicate content issues by specifying the “rel= canonical”.

canonical-url

For Example:

Cannonical

How a canonical issue arise?

Content duplication can happen in a lot of ways. A canonical issue arises when:

  • Duplication with multiple URLs due to CMS
  • Duplication due to URLs with parameters and session IDs.
  • Duplication due to accessibility on different protocols like HTTP, HTTPS & WWW. That means when the same content is accessible from multiple URLs.

For example:

http://www.example.com

http://example.com

http://www.example.com/ and

https://www.example.com are different pages, but content served is same.

Canonical tags can also be useful to solve www and non-www duplicate content.

 Let us consider 3 scenarios:

Case 1. You’re republishing an article on your website, which has been published already in another website earlier.

Case 2. You are having a site, where multiple URLs trigger the same piece of content. for example “test.com and test.com/index“. Both pages are having the same content, but have different URLs

Case 3. Lets say you have an e-commerce site where a category page is triggering the same content as another page.

All these 3 cases creating duplicate content.

In Case 1 – You are copying content from another site. That’s plagiarism

In Case 2 and Case 3 – It is having same content on multiple pages. This is called canonicalization.

What can be done to resolve the canonical issue?

The best and most effective way to resolve the canonical issue is

Case 1 – <link rel=”canonical” href=”<original URL>” />

Case 2 and Case 3 – Use a permanent 301 redirect with .htaccess file to redirect the main page.

This will ensure Google will not see your pages having duplicate content.

How to Manage 301 Redirects:

If your web server runs Apache, a simple rewrite rule added to your .htaccess file will handle everything for you. Here’s an example:

RewriteEngine on

RewriteCond %{HTTP_HOST} ^ example.com [NC]

RewriteRule ^(.*)$ http://www.example .com/$1 [L,R=301] 

The above code represents “everything found in the 1st domain should be considered permanently redirected to 2nd domain”.

  • ^(.*)$ means select everything from http://example.com and append to http://www.example.com by calling it $1
  • R=301 refers to status code 301, the “permanently moved” redirect.
  • L means that this is the final instruction for anything matching that pattern. No other redirect rule after this one will effect these redirects

The code is copied into the .htaccess file, save it and upload it to the root of the domain.

Finally, Double check that the domain names are correct when implementing a permanent 301 redirect.  Once test that the redirect is working properly.

adhishta Infotech
Content Writer | Adhishta Infotech
Adhishta Infotech is one of the best Web designing & web development company in Hyderabad, India.

Leave a Reply

Your email address will not be published. Required fields are marked *