Canonical URL SEO issue & How you can fix URL Canonicalization?

Canonical issue is a common issue that websites are facing. Due to the this many informative websites are not performing well in search engine results page.


Ranking top in search engine always depends on the quality of information a website is providing, how the site is optimized & the back-links along with the content language and it’s uniqueness.Still any site is not performing well in search engine then there must be some issues like canonical, blacklisted IP etc.


What is canonical issue?

For example if you have the website


and then the index page can be also accessible by these URLs:

In these cases all the pages are same at user end, means the user will found the same page information at each URL. But search engine crawler treats these pages as different pages. So the crawler will treat it like different pages.


Everything the title, meta tags, content etc are same on these pages. So the search engines will consider it as a case of content duplicate and the search engine will consider the site pages as spam and it can de-index your page and affect the search result page in short the Site Ranking decreases.


How to can you solve URL canonical issues ?

We can solve this issue by redirecting all these URLs to a single URL permanently(301 Redirect).
By uploading a .htaccess file we can easily redirect all the URLs.


1.Code to redirect non www domain ( to www domain ( permanently (301):

[sourcecode language=”plain”]
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourwebsite\.com
RewriteRule ^(.*)$$1 [R=301,L]


2.Code is to redirect index.html to

[sourcecode language=”plain”]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.html\ HTTP/
RewriteRule ^(.*)index\.html$ /$1 [R=301,L]


3.Code is to redirect index.php to

[sourcecode language=”plain”]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*folder/index\.php\ HTTP/
RewriteRule ^(.*)folder/index\.php$ /folder/$1 [R=301,L]


After adding these rules in .htaccess file we just need to upload it to the root folder of the website.