Sunday, December 21, 2008

One Blog, Multiple URLs

Having multiple blogs in a custom domain is a simple matter, with a custom domain array. Sometimes, you may want to publish just one blog, but use multiple domain URLs for that blog.

There are several ways to get what you want - each represent subtle variations from the standard custom domain array model, that are occasionally confused with each other. The variations will produce completely different results, so consider these details carefully.

To get the total picture here, you may want to review proper domain configurations.

Not all DNS hosts will support each of the solutions, described here. Make sure that the support technician at your registrar understands what you need, and if offered an alternative solution, consider the offering with great care. Be prepared to assert your needs, and escalate the issue to a supervisor, if necessary.

One Domain, Two URLs, Two Blogs, Separate Content Displayed In Each Blog

One domain can have a home blog, accompanied by any number of virtual hosts. You will need a separate blog for each virtual host in the domain, and each blog has to be published to the URL of the specific virtual host.
First, setup the domain root. Symmetrical configuration.

mydomain.com. 3600 IN CNAME ghs.google.com.
www.mydomain.com. 3600 IN CNAME ghs.google.com.

Publish a blog to either "mydomain.com" or "www.mydomain.com".

Or asymmetrical configuration.

mydomain.com. 3600 IN A 216.239.32.21
mydomain.com. 3600 IN A 216.239.34.21
mydomain.com. 3600 IN A 216.239.36.21
mydomain.com. 3600 IN A 216.239.38.21
www.mydomain.com. 3600 IN CNAME ghs.google.com.

Here, you can only publish a blog to "www.mydomain.com".


Note very carefully here. An "A" / "CNAME" referral has to point to the primary address for the blog. In the above example, the blog has to be published to either "mydomain.com" or "www.mydomain.com". An "A" / "CNAME" referral to a non published URL is useless, and will not substitute for a "301 Moved Permanently" redirect to the published URL.


Next, setup a virtual host.

blog.mydomain.com. 3600 IN CNAME ghs.google.com.
www.blog.mydomain.com. 3600 IN CNAME ghs.google.com.

Then, publish a second blog to either "blog.mydomain.com" or "www.blog.mydomain.com".

If you want to have both the domain root, and one or more virtual hosts, you'll need multiple blogs published in Blogger.
  1. One published to either "mydomain.com" or "www.mydomain.com".
  2. One published to either "blog.mydomain.com" or "www.blog.mydomain.com".

But what if you want one blog, alternately addressed as either "mydomain.com" or "blog.mydomain.com"? First, setup the primary URL, as above.

mydomain.com. 3600 IN CNAME ghs.google.com.
www.mydomain.com. 3600 IN CNAME ghs.google.com.

Again, publish a blog to either "mydomain.com" or "www.mydomain.com". And again, "mydomain.com" and "www.mydomain.com" wil be the primary / secondary URL pair. Now, consider the options.

You can combine the two virtual hosts, and the separate existences of "blog.mydomain.com" and "www.mydomain.com", using either a "301 Moved Permanently", an iframe, or a "CNAME" referral. The variations produce completely different results, so consider them carefully.

One Domain, Two URLs, One Blog

If you want to use the same blog for "blog.mydomain.com" and "www.mydomain.com", you'll generally use a "301 Moved Permanently", or a "302 Moved Temporarily", at the DNS Host, with the alternate URL(s) redirected to the primary URL.
  • With a "301", the alternate URL will redirect to the primary URL, transparently. Any alternate URLs will never be seen, they will only land the reader at the primary URL - if your readers click on a link using the alternate URL, they will see the blog, but under the primary URL.

    If you depend upon having the blog indexed by the search engines, you will want this choice. The search engines will index only the primary URL, and all will be well.

  • With a "302", the alternate URLs will redirect to the primary URL, but not transparently. The alternate URL will have as much visibility as the primary URL - if your readers click on a link using the alternate URL, they will see the blog, under the alternate URL.

    If you depend upon having the blog indexed by the search engines, you won't want this choice. The search engines will index both the primary and alternate URLs, they will see this as "duplicate content", and both URLs will be penalised.
If you're going to use a "301" or "302", choose carefully.

Two Domains, Two URLs, One Blog

A variation on the above configuration would have a second domain, substituted for the virtual host, directed to the first domain. Again, you will want to use a "301 Moved Permanently" redirect, to the primary URL.

One Domain, Two URLs, Two Blogs, Same Content Displayed In Both Blogs

A third alternative would be to have multiple blogs in the custom domain cluster (as in the solution discussed at the top), each blog published to a separate virtual host in the domain. If you want to duplicate the content of one blog in another blog, use an iframe in one blog, sourced from the other blog. Your readers will view the alternate blog, as the alternate URL, and see the content from the primary blog. The search engines won't look at the content of the iframe, your secondary blog won't have much content, and all will be well.

One Domain, Two URLs, Two Blogs, A Spurious Variation

An interesting variation on the first setup is to have a "CNAME" referral from one virtual host to the other.

blog.mydomain.com. 3600 IN CNAME www.mydomain.com.

Then, the normal "CNAME" referral of the second virtual host to Google.

www.mydomain.com. 3600 IN CNAME ghs.google.com.


This produces the same final result as a pair of consecutive "CNAME" referrals!

blog.mydomain.com. 3600 IN CNAME www.mydomain.com.
www.mydomain.com. 3600 IN CNAME ghs.google.com.

The one difference is that the first variation requires two DNS lookups instead of one.
  1. Lookup of "blog.mydomain.com" (which says "Look at www.mydomain.com").
  2. Lookup of "www.mydomain.com" (which says "Look at ghs.google.com").

If your readers are interested in "blog.mydomain.com", have them look, directly, at "blog.mydomain.com" referred to "ghs.google.com".

blog.mydomain.com. 3600 IN CNAME ghs.google.com.


Choose your blog clustering carefully, according to what you want your readers, and the search engines, to see. Don't use spurious variations.

>> Top

4 comments:

Pete Kosednar said...

Hello Chuck:

On this setup I show two name servers for my site. On Digg your site shows 4 what am I doing wrong?
216.239.32.21
216.239.34.21
216.239.36.21
216.239.38.21

www ghs.google.com

Chuck said...

Pete,

The "A" / "CNAME" records are served from the servers named in the "NS" records.

The "A" (host) / "CNAME" (alias) records are "DNS addresses". The "NS" records are "DNS servers". The DNS addresses go on the DNS servers. Your site has 2 (maybe 3) DNS servers, and the address information is stored on the servers.

When YOU configure your domain, you add addresses. Your registrar generally adds the servers, as those are wwhat you pay for and they provide.

Allie K said...

Lots of interesting info here. I purchased a custom domain ("Custom_A.com") for my blog. I setup the blog ("Blog_A.com") to point to that domain. I now want to use a new custom domain ("Custom_B.com") for Blog_A. Is there a way for me to redirect the url Custom_A.com to the url Custom_B.com? If it helps, i just purchased the domains through Google (through the blogger site). Any help would be GREATLY appreciated. I'm thinking I might be over my head here, though.

Chuck Croll said...

Allie,

This would be a discussion better conducted in Blogger Help Forum: How Do I?. It's much easier to diagnose problems and give advice, there.