1

I've found here similar topics but not exactly similar and without satisfying references -

I'm going to launch a new domain, I understood it's better to have one pattern - whether www or non-www, so I'll go with WWW, using this .htaccess command:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(?!www\.)(.+) [NC]
RewriteRule ^(.*) http://www.%1/$1 [R=301,NE,L]

Question is - In this case, Do I need to add Only www.domain.com to my sites, or also the non-www.?

and If I add both, Do I set in both "use www as my preferred domain"?

2

Even if you have redirects and/or canonical tags set up to your preferred domain, you should still set your preferred domain in Google Webmaster Tools (GWT for short)

To do this click the gear icon in the top right of GWT, and click 'site settings', then tick your preferred domain.

Most of the time this option will be greyed out (not selectable) and there will be a message telling you need to add both version of your domain to GWT, 'www' and non-www' prefix.

To add the other version of your domain, simply follow the same steps you took when adding the original domain to GWT, only adding the opposite version. The verification process is usually easier when adding the 2nd version of your domain.

Once both have been added, click into your preferred domain from the list of domains in GWT, then click the gear icon top right and tick the box next to your preferred domain.

More info from Google here:

Set your preferred domain (www or non-www)

Add your site to Webmaster Tools

1

As you're doing a permanent redirect, Google will treat any non-www links it finds the same as the www ones so you only need to submit one. You should submit it in the form that you have decided on (so in your case, the www version). x

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.