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.
There should be a way to solve this canonical issue..
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.
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.



Great post. This post clear my doubt of canonical issue. But I don’t understand that code.
Where do you find it difficult?
Where I should write that code?
It’s specified in the article itself. Read twice in case you missed it.
This Post is really helpful for me..Thanks so much sir
Before reading this post I was totally confused what is canonical issues and 301. But now my problem has completely solved..
Salute sir..
Keep update..and sir I have one request pls post seo interview questions and answers so that i may get succeed in interview..thanks sir..
your post is use full for me thanks
This post is so useful. Thank you so much! Really useful and clear solution about canonical issue. I believe that Google now don’t actually penalize my sites for duplicate content or page.
thank you for this great post..
I want to know about the code please tell me
Be specific please.
Really a great post, thanks a lot for sharing this.
Sir pls tell me clearly canonical issues because i am fresher for that.
Kriti, I don’t know how more comprehensive this guide can be. Lend your attention again pls.
The code I have given is a done for you solution to solve canonical issues. And it’s cleasrly mentioned how the code is to be customized for your site. If you are interested to learn about exactly how this piece of code is executing the purpose, you have to get your hands dirty with mysql databases.
Its really good post. Now i can figure out about the issue easily but would like to know more about this coding because i have uploaded .htaccess file on my hosting server for the website but never mentioned such codes ever. It would be really much helpful if u can explain how these code is resolving the issue ?
I really appreciate ur work nd thanks.
Really a great and helpful post. This post clear my doubt of canonical issue.
Thanks for sharing this.
Hi Admin,
Nice Post !!
Your article is very helpful for me and i very clear about canonical issue. but i saw their is any code like < link rel=canonical resolve the canonical issue. so we put the code on homepage.
or can you some advice me what is the difference and their work on 301 redirect code and < rel=canonical…
Thanks. rel canonical tags can also be put to avoid address the canonical issues. But as far www vs non-www issue is concerned, for static sites, 301 is the best solution. Other urls having similar content can be addressed by rel=canonical tags. Click here to know more
CD, tell me another way too to sort out the canonical issue, i.e. meta tag inclusion. And Which one is more suitable in every aspect???
To adress the www & non www issue 301 is the best solution. But to canonicalize other urls having similar content rel canonical tags can be used. Click here to know more.
Thanks for this post. It helps me lot.
Really a great and helpful post.
hi cd
i saw your comment you solved the problem of canonical issues if it is let me know . In above code domainname.com is occur in three lines so i will have to put techiwebi.com as it is for resolve the canonical issues.
thanks & regards
pallavi singh
Can you explain [NC] sir.why this is be use after my site name.????Explain in detail
Its very useful post to solve canonical issue.