That means you have 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/).
The preferred domainname should be entered into the Google Search Console (formally Google Webmaster Tools) and all other versions should be redirected to the preferred domainname with 301-redirects.
Table of Contents
Entering the preferred domainname in the Google Search Console (GSC)
In case you are not yet making use of the Google Search Console, you can unlock your website and use it with the Google Search Console (www.google.com/webmasters/tools/) in just a few minutes. You can also use the following settings to mark your preferred domainname.
If you are logged into the GSC and have chosen your website, click on the gear in the upper right corner of the Settings to open the drop down men.
Within the Website Settings you can now make your selection under “Preferred Domain”.
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.
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.