You can have a domain with WWW or without WWW. But make sure that you are having only one kind of URL and not both. For instance, www.domainname.com is considered as sub domain of domainname.com and search engine ranking will be distributed between both URLs if users can access the page in both formats.
As WWW is the most used URL type compared to non-WWW by the users, it is preferred to have domains with WWW and having redirects to the proper domain name for users who miss WWW while trying to access your website. You can check it yourself using Open Site Explorer. Even from technical point of view, WWW is preferable. If you are curious enough then you can check more on this.
If you have both versions of pages, i.e. with WWW and without WWW, then do 301 redirection of duplicate page and do not use canonical tags on duplicate page. This helps you out people not visiting both the page formats of you have added both versions of page URLs by mistake in static sitemap of your website. If you have dynamic sitemap.xml file then there is no need to bother as it is intelligent enough to detect your mistake and let you know to correct it.
How to do 301 redirection?
If your website is hosted on servers running Apache then you can perform 301 redirection by accessing .htaccess file. By implementing the code as below in .htaccess file, you can achieve 301 redirection.
RewriteEngine on
RewriteCond %{HTTP_HOST} *!^www*.domainname\.com [NC]
RewriteRule (.*) http://www.domainname.com/$1 [L,R=301]
If the website is not hosted on servers running Apache then contact your website hoster for details. WWW to non-WWW or vice-versa redirection is commonly called as canonicalization. For this you need to make sure that you own both WWW and non-WWW version of your domain names. Sometimes it happens that someone else will be the owner of the other version of your domain name. Then set the preferred domain name in Webmaster Tools à Gear Icon à Site Settings à Preferred domain. Now, carry on with 301 direction as guided above and drive all traffic to a single landing page of your domain either with or without WWW.
Good One. Nice Info.
ReplyDeleteHappy to share!
Delete