Wednesday, May 25, 2011

A Custom Blog and 404 errors!


I struggled for over a day with 404 errors and domain mapping issues and finally figured out the simple steps to set up my Google blog mapped to my custom domain. I also managed to add an alias to this blog site. Just jotting down the steps here for future reference ...

You would've created your blog under the name say:
myblog.blogspot.com

Now you want to move it to your custom domain which you just purchased say:
www.mydomain.com

Also you might want to map blog.mydomain.com and mydomain.com to land the user on your blog page directly. The latter is called a "naked" domain and has to be handled as this is not mapped by default.

Steps to create custom blog at www.mydomain.com

1. Go to your blog Dashboard (link is on the top right of your screen)
2. Select the Settings tab
3. Select the Publishing tab
4. Click on the Custom Domain link and switch to Advanced Settings
5. Enter your domain name here  www.mydomain.com
6. Check the "Redirect mydomain.com to www.mydomain.com"
7. Enter the captcha and save settings.

Now you will see that on entering www.mydomain.com, you directly land on your blog page.
Entering the naked domain mydomain.com also lands you directly to your blog page.

But if you try blog.mydomain.com, you will get a page not found error. Yes of course, its never been mapped so far!

Now we'll add the mapping to blog.mydomain.com. You could directly map to the subdomain in step 5 above if you have your own home page.
But then accessing www.mydomain.com will give you an error if you've just registered and don't have your home page ready. It happened in my case.
So I intend to soon move the blog from www.mydomain.com to directly blog.mydomain.com.
But for now, both of them map to the blog site.

Steps to map to http://blog.mydomain.com

Go to your domain name provider's webpage and login to administer your domain. For me it was https://access.enom.com.

In the Host Records section, click on edit and add the following records:
Host Name: blog
Address: http://www.mydomain.com
Record Type: URL Frame

Save the settings and in your browser try to access blog.mydomain.com, you will be taken to the blog and the URL remains at blog.mydomain.com
If you had chosen URL Redirect in the record type above, it will change the URL in your browser to show www.mydomain.com, which might not be what you want.

If you are finding issues in the mappings and getting errors, and feel totally stuck, switch your blog from custom domain to blogspot and then switch back. This will clear any wrong settings done in your mappings. Go through the above steps and you should have it working.

So finally, Happy blogging !

1 comment:

  1. Thanks a lot chetan. I'll keep this bookmarked, just in case! :D

    ReplyDelete