To minimise Duplicate Content problems and to ensure a better indexing by the Google-Bot, Google recommends using a single domain name for a website. Previously it was possible to have multiple www and non-www domains and then ‘fix’ this in Google Search Console. Now, it needs to be done with server redirects to ensure only one copy of the website is available.
You will need to decide which hostname should be preferred for your domain: without the www. (http://domain.com/), with the www. hostname (http://www.domain.com/) or even by a totally different hostname like shop (http://shop.domain.com/)
If your website is discoverable under multipe hostnames then it can lead to confusion for Google, a waste of the Google crawler resources, potential URL ‘flipping’ and even canibalisation issues.
GSC preferred domain feature has been removed
Previously it was possible to tell Google to focus on only one version of your site through the Google Search Console but this GSC feature has now been removed.
Set up redirects from non-www to the www. domainname
To ensure that your users, as well as other search engines’ crawlers are always send to your preferred domain, you should set up redirects. This is the best method but will require some access to your webserver configuration.
Alternatively you can use canonical tags in the HTML to tell Google that the ‘real’ website page is under a different URL.
Our information on keyword canibalisation is available and includes information on how to use canonicals to fix the problem. (Ideally, you will set up the required redirect and only expose one version of the site.)
Handle internal links uniformly
Once you have chosen your preferred domainname, you should design the internal links uniformly and follow your strategy to the letter. If, for example, www.domain.com was set as the preferred domain, always link your internal pages using the pattern http://www.domain.com/a-directory/file.html. It is recommended that you use absolute paths for your internal links instead of relative ones.