Tuesday, March 04, 2008

Custom Domains Using 301 Redirect In DNS Setup

When you setup your Google Custom Domain, the instruction for the DNS setup is rather basic.
Add one or more "CNAME" records. Point "www.mydomain.com", and / or "mydomain.com", to "ghs.google.com".
Unfortunately, not all DNS hosts support "CNAME" referrals to both the domain alias ("www.mydomain.com"), and the primary domain ("mydomain.com").

Most DNS hosts will support CNAME referral for "www.mydomain.com". Less will support CNAME referral for "mydomain.com", and there's a problem. Some people will try other solutions, like Domain or URL Forwarding.

Some DNS hosts, like GoDaddy, will substitute a 301 Redirect for the primary domain, pointing it to the "www"alias.
  • Sign into GoDaddy - either directly (using a bookmark) - or through the Google Apps "Advanced DNS Settings".
  • Go to "Domains >> Details" for your domain.
    • Click on "Total DNS".
    • Under "CNAMES (Aliases)", add an entry for "www", pointing to "ghs.google.com".
    • Click OK.
  • Go back to "Domains >> Details" for your domain.
    • Click on "Forwarding".
    • Click "Enabled".
    • For "Forward To:" enter the URL of your "www" alias, for instance "www.mydomain.com".
    • For "Redirect Type:" select "301 Moved Permanently".
    • Click OK.


Having equated "mydomain.com" to "www.mydomain.com" at the DNS server, you should be able to equate it in Blogger also. Use the "Advanced Settings" wizard, and select "Redirect mydomain.com to www.mydomain.com.". If you wish to refer to "mydomain.com" as "www.mydomain.com", with your Blogger blog published as "www.mydomain.com" using the "Advanced Settings" wizard, you will need to do both.

A "301 Moved Permanently" redirect is an effective way of equating the primary domain to the "www" alias, in many domains. Setup properly, it is even acceptable to the search engines.

But it has to be setup properly, and at the DNS server. Setup improperly, it will only contribute to problems with your blog, and its existence as a custom domain. Some DNS hosts will not support a "301 Moved Permanently" at the server level; if that's what you face, you will have to use a "CNAME", or find another DNS host.

A 301 Redirect setup in the browser code, and run in the readers browser, will cause problems with the search engines, and with many browsers. A client side meta refresh, or JavaScript redirect, will make the search engines believe that your blog is setup as a doorway page. Some browsers may detect this as a browser hijack. Neither possibility will help you, or your readers, in the long run.

>> Top

5 comments:

unish said...

i have a domain called trainmesalem.com which is registered to Godaddy. when i put http://www.trainmesalem.com my blog shows up but when i put http://trainmesalem.com it shows parked page of Godaddy. I want have to my blog show up when both types of url is given. So does your tip do that?

Chuck said...

Unish,

If "trainmesalem.com" is directed to the GoDaddy parked server, using the "301 Redirect" is probably the best way to get it to equate to "www.trainmesalem.com". Try it and see.

ChristianZ said...

This information actually helped me. Thanks.

Sai Sundar said...

thank you for this post.
www.snsundar.com

Sanskar Shrivastava said...

You have been helping me since the day I purchased my domain name both here and on google forums.

On godaddy I have forwarded domain.com to www.domain.com (permanent 301)

and it works perfect. but when i check my site using tools like this:
http://www.seoconsultants.com/tools/check-server-headers-tool/#Report

They tell me that i am using a 302 temporary redirect and not 301. but i want 301 redirection please help me.