Canonical issues are a major problem of websites as long as Search Engine Optimization is concerned. If you are still unclear about website’s canonical issues, I must tell you what is it.

Let us talk about the domain name of a website, www.domainname.com if you type this in the address bar of your browser, homepage of the website will open up, you can get the same result by typing,

http://www.domainname.com/ (www version)

http://domainname.com/ (non www version)

http://domainname.com/index.html
or
http://www.domainname.com/home.php
or
http://domainname.com/index.php
or
http://www.domainname.com/default.aspx etc.

This is what is canonical issue which means your website is having different urls (Uniform Resource Locator) with the exact same content. Modern search engines are not smart enough to differentiate between canonical urls and genuine duplicate contents. In this case your website will be considered as a site having duplicate content which is a bad thing as far getting ranked in Search Engine’s Result Pages (SERP) is concerned.

solving canonical issues for website seo

There should be a way to solve this canonical issue..

There are several ways to solve the problem but I would discuss only the .htaccess way of doing it.

301 redirection with .htaccess file is the solution.

  • Create a .htaccess file. Open Notepad. Name it as .htaccess.
  • Paste the below code into the notepad. You have to customize the code by replacing your own domain name. And in place of index.html you have to replace it with your home page file name. Another thing is, you have to decide whether you want www version or non www version of your cannonical url. Both are fine. But the common trend is www version. If you want non www version of your domain name just remove the www. portion from the code.

# For security reasons, Option followsymlinks cannot be overridden.

#Options +FollowSymLinks

Options +SymLinksIfOwnerMatch

RewriteEngine on

RewriteCond %{HTTP_HOST} ^domainname\.com$ [NC]

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

RewriteCond %{THE_REQUEST} ^.*/index.html

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

(Code is taken from WebsiteChecklist.Net )

In case of wordpress blogs the following code is needed. And you can set your www or non www version within the settings of wordpress dashboard.

Code is here

# BEGIN WordPress

RewriteEngine On

RewriteBase /

RewriteRule ^index\.php$ – [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

# END WordPress

You have created your .htaccess file now. Now your job is to upload the file into your web server’s root directory with the help of FTP  (File Transfer protocol).  You are done. Now check all different urls mentioned above are getting redirected to the canonical url you set up with your .htaccess file.

If you would like to host the same content different websites, then you have to use rel canonical tags properly. Here is a guide to do that.

Bonus Tip: Try to use your canonical url whenever you are getting links from other websites or other pages from your own site. This will escape a 301 redirection which is good for SEO. This is how you can solve your canonical issues and render your site more search engine friendly.