![Setting the Preferred Domain for Your Website daily-golden-nugget-1083-29 Setting the Preferred Domain for Your Website daily-golden-nugget-1083-29](http://www.jwag.biz/newsletters/images/daily-golden-nugget-1083-29.jpg)
For today's Daily Nugget, I'm answering a direct question that came in from one of my readers. Did you know you can send me questions? Submit them through the contact form on the jWAG site, or send them to me through Google+ or Facebook.
The answer to this question is a little technical, but this brings together a few different topics.
Here's the question:
My nephew's been enjoying his SEO research through your blog and had a question about redirecting from [http://domain.com] to [http://www.domain.com] so that Google sums all the traffic from both URLs. Currently both the http:// and http://www are directed to the same index.html through our DNS record. Should the http:// be directed to a different index page that then redirects to the www index page to make Google happy?
This is a great question with a lot of subtle nuances that need to be addressed. I've broken each one down...
DNS:
From the way the question is phrased, I assumed the DNS had IP address entries for the domain.com and the www.domain.com. I looked it up and found this:
DNS Settings Version 1 | |||
@ | IN | A | 123.123.123.123 |
www | IN | A | 123.123.123.123 |
Those are fine. You don't have to change that. But a more common method of DNS settings now would be like this:
DNS Settings Version 2 | |||
@ | IN | A | 123.123.123.123 |
www | IN | CNAME | @ |
Some DNS software will represent the domain names as "domain.com" instead of "@" shown above. Every DNS is quirky and with their settings, and it's always best to double check what you are doing when editing a DNS. A single misplaced period will remove your website from the internet.
If you are using the DNS Settings Version 1 and you have the ability to update the reverse DNS settings for your domain, then I would make sure to point the address 123.123.123.123 to "www.domain.com" instead of the default "domain.com." If you don't have control over the rDNS then don't worry about it. That's a high level tweak that's not a necessity, but it's one of those "cross the T's and dot the I's" type things that is included in my high level technical SEO review.
INDEX PAGE REDIRECTS:
I see what you are asking there. You are wondering if you should direct the http:// version of the site to a page like index2.html, then redirect that page to your index.html page.
Visually it would look like this:
http://domain.com
------jump------ >http://www.domain.com/index2.html
----------jump---------- >http://www.domain.com/index.html
------jump------ >http://www.domain.com/index2.html
----------jump---------- >http://www.domain.com/index.html
I could think of a few good reasons for this, and they all have to do with tracking your users. By setting up the index2.html page, you would be able to record a hit to that page before forwarding the user to the real page.
However, this type of tracking would require that you have analytics software directly installed on your server because Google Analytics wouldn't be able to see this fast hit. I have fond memories of this type of tracking from my early website from 1994 through 2003. That was back before Google Analytics and utm tracking existed. I think you should skip this idea now.
APACHE:
The easiest thing to do is add 4 lines like this to the Apache setting on your server:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/?(.*) http://www.domain.com/$1 [L,R,NE]
RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/?(.*) http://www.domain.com/$1 [L,R,NE]
That code looks for the "www" in the URL and forces the user over to the "www" version if it's missing. This is a server level redirect to force all visitors, Google included, to the www version of your site.
Those 4 lines work on my servers, but they may not work on all versions of Apache servers.
I have to warn you though: the above Apache hack is only going to work if you are using a single domain name on your website. This will not work for you if you have alias domain names, like .net or .mobi even m.domain.com. If you have multiple domain names aliases for your site, you will need a really good Apache programmer to help you, or you will have to program a different solution right into the code of your website.
GOOGLE:
You don't need to make any changes to Google Analytics because it will track any domain name with its default tracking settings. However you do need to tell Google Webmaster Tools that you have two versions of your site, and that you only want one version to appear in the SERPS.
To do this, you would go into your Webmaster Tools account and set your preferred domain to www.domain.com following these directions:
1. Log in to Webmaster Tools
2. Click the setting gear at the top right
3. Click Site Settings from the drop down menu
4. On the Site Settings screen, click the radio button next to the www version of your domain
5. Click the Save button
Here's some screen shots for those directions:
![Setting the Preferred Domain for Your Website 1083-google-webmaster-tools-site-settings-64 Setting the Preferred Domain for Your Website 1083-google-webmaster-tools-site-settings-64](http://www.jwag.biz/newsletters/images/1083-google-webmaster-tools-site-settings-64.png)
You will need to verify control of both the domain.com and www.domain.com versions of your domain name for this to work. You might need to follow a few additional verification steps that will appear when you click save.
MAKING GOOGLE HAPPY:
So I'd like to address the idea of making Google happy. Even though I often say "to make Google happy" I know that the real truth is that you always need to think in terms of making your customer happy.
Previous content building and link building schemes were all created to make Google happy, which in turn led to higher ranking. However, one day Google woke up and was very unhappy, downright mad even. That's when they realized there were way to many people out there trying to make them happy instead of making customers happy.
So Google started thinking differently. They started to figure out what would make customers happy and they redesigned their algorithm to measure customer happiness rather than their own. They now penalize any website that tries to "make Google happy."
I've always felt that every website should be focused on customers rather than Google. Sometimes this focus doesn't seem to help you with your immediate ranking, but it does create a long term plan of website ranking that won't fluctuate every time Google does a major algorithm change.
Ever since Google woke up unhappy, I now say "It's okay to try and make Google happy, but it's more important to make your customers happy."
Hopefully this answers the question.
What else can I help you with?