Duplicate content in search engine database like Google is strongly prohibited. Website that evolve with both domain calling protocols of www. and without www create two similar contents each time the search engine bots visit the website to index pages. This force search engine to abandons indexing pages with duplicate contents.
The two domain calling protocols are
Assume my domain name is “mydomain.com”
My website will evolve in two URLS
When I put content to the website, each page I create will propagate as two URL
If I create a page for Domain Registration it will create two URL like shown below:
To avoid this just allow one protocol to be used during page calling by the browser. To achieve this you must redirect one protocol to the other.
let say I want to use only www.mydomain.com
Follow this steps if you are website is hosted in cpanel
Step#1 – Login to cpanel and go directly to the domains sections
Step#2 – Just click redirect to go to the next page
In this step you will have to do 4 actions as shown in the cpanel screen snapshot above
Select your domain that you want to Canonize
Put in the space the full URL you prefer to use throughout eg http://www.mydomain.com
Select “Do not redirect www.
By doing so your URL that has no www will be redirected to the one with www. and at this stage duplicate contents possibility is solved and your website will not now be penalized by Google due to duplicate contents