5

Using Google Webmaster tools my site is set to 'Display URLs as www.mydomain.com' as opposed 'mydomain.com'. This is the setting for both of these sites in Webmaster tools and has been for several months now.

Google has honoured this, but recently the site's ranking has started to improve and it is ranking for search terms it didn't previously rank for.

However, Google is not displaying these new results using my preferred domain (without the www).

Does anyone else have experience with this behaviour? Why would Google do this?

2
  • 1
    Do you have a URL rewriter active? Dec 10, 2010 at 18:37
  • No, that's a good idea. Still curious to know why Google ignores my preferences though Dec 10, 2010 at 18:43

2 Answers 2

4

Even though you set a preference, Google still doesn't truly know which one you prefer if there's no domain.com --> www.domain.com rewrite or 301 redirect. Backlinks that point to domain.com rather than www.domain.com will also confuse Googlebot as your non-www domain still looks relevant.

The easiest method would be to add some logic to your root .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomainname.com$
RewriteRule (.*) http://www.yourdomainname.com$1 [R=301]

From the related Google Webmaster help page:

Note: Once you've set your preferred domain, you may want to use a 301 redirect to redirect traffic from your non-preferred domain, so that other search engines and visitors know which version you prefer.

0

IMO, Google will show the preferred domain in the results if it determines that http://mydomain.com/foo is same as http://www.mydomain.com/foo. Google crawls both version of your website. So, if it has crawled http://mydomain.com/bar but not http://www.mydomain.com/bar, it might show http://mydomain.com/bar until the time it concludes that both pages are same.

Nevertheless, this will still confuse other search engines that do not let you set a preferred domain. Best cross-search-engine solution is to implement a 301 Permanent Redirect for your website that tells browsers and bots the correct location of a page. With 301 Redirect, the bot will not index the wrong version of the page, and, in case of Google, the page rank is carried over to the redirected page.

I've explained how to setup 301 redirects on my blog (it's a relatively long article covering multiple platforms).

1
  • 1
    FYI, You should always mention when you're linking to your own website here. Otherwise you may find yourself getting downvoted or worse.
    – John Conde
    Apr 2, 2011 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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