Friday, January 25, 2008

Getting Rid Of An Infinite Loop On A Blogger Custom Domain

I had a couple people email me with a problem that can be hard to identify. Their CNAME records are correct, but when they type their URL in a browser their blog never loads and they never see a 404 error. What has happened in these cases, is that they have managed to setup and infinite loop of redirects from their domain back and forth from Blogger.

I'll illustrate how the problem arises:
  • Your domain has a CNAME setup for the www.yourdomain.com
  • Your primary domain (yourdomain.com) is set to either forward to your old Blogspot address or your www subdomain.
  • You set Blogger to publish to yourdomain.com - oops, big mistake. In addition to setting your Blogger to yourdomain.com, Blogger will have the default setting checked off to redirect www.yourdomain.com to yourdomain.com (since you have told Blogger to publish to yourdomain.com).
How it becomes an infinite loop:
  1. Entering www.yourdomain.com calls Google's servers as it should since you have a correct CNAME record entered.
  2. Blogger looks up the full domain in its DNS servers, finds that your blog is set to publish at yourdomain.com and tells your browser to head over to that URL instead.
  3. Since you setup domain forwarding on your primary domain (yourdomain.com) to point to your old Blogspot address and Blogger redirects all requests for the old URL to the correct custom domain, your browser is now told to go to yourdomain.com - where you just came from!!
  4. INFINITE LOOP!
The solution:
  • Enter the correct domain name in your Blogger custom domain settings. If you have a CNAME setup on www, you must enter www.yourdomain.com as your custom URL.