Skip to main content

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 !

Comments

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

    ReplyDelete

Post a Comment

Popular posts from this blog

Minimal required code in HTML5

I've encountered this question repeatedly of late.
"What are the tags required at bare minimum for a html file?"
Earlier there were a bunch of mandatory tags that were required for any html file. At bare minimum, the recommended structure was: (ref: http://www.w3.org/TR/html4/struct/global.html)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML>   <HEAD>     <TITLE>A small HTML</TITLE>   </HEAD>   <BODY>     <P>Small HTML file!</P>   </BODY> </HTML>
Yes, using capitals for the tags was the way to go! Those were the days of the purists and strict was the way to be. Now open your notepad and copy the above code, save the file as old.html and launch it in Chrome or Firefox. You will see only one line "Small HTML file!" shown. Now launch the developer tools in Chrome or Inspect Element in Firefox. This can be done by pressing CTRL+SHIFT+I in both…

Using duplicate IDs in HTML

Well today I'm being a bit controversial. Let us see what the HTML5 spec says about unique IDs in a HTML file.
The id attribute specifies its element's unique identifier (ID). The value must be unique amongst all the IDs in the element's home subtree and must contain at least one character. The value must not contain any space characters. An element's unique identifier can be used for a variety of purposes, most notably as a way to link to specific parts of a document using fragment identifiers, as a way to target an element when scripting, and as a way to style a specific element from CSS. Yes its been mentioned almost everywhere on the planet that ID must be unique. Now let us look at the below code,


Launch


dup.css


#p2 {
  background-color: yellow; 
}

dup-id.html

<!DOCTYPE html>
<html>
  <head>
    <title>Duplicate ID Tester</title>
<link rel="stylesheet" href="dup.css" />
  </head>
  <body>
<p><a href=&quo…

Fixing Date, Time and Zone on RHEL 6 command line

Had to fix all time related issues on a remote RHEL 6 server which runs without any windowing system. Plain ol' command line. Documenting steps here for future reference:

Check to see if your date and timezone settings are accurate:
# date
# cat /etc/sysconfig/clock

The server I accessed had wrong settings for both the commands. Here are the steps I used to correct:

Find out your timezone from the folder /usr/share/zoneinfo
# ls /usr/share/zoneinfo

Mine was pointing to America/EDT instead of Asia/Calcutta

Update and save the /etc/sysconfig/clock file to
# sudo vi /etc/sysconfig/clock
ZONE="Asia/Calcutta"
UTC=true
ARC=false

Remove the /etc/localtime
# sudo rm /etc/localtime

Create a new soft link to your time zone
# cd /etc
# sudo ln -s /usr/share/zoneinfo/Asia/Calcutta /etc/localtime
# ls -al localtime
Now it should show the link to your time zone

Set your hardware clock to UTC
# sudo hwclock --systohc --utc
# hwclock --show

Update your time from a NTP server (Red Hat NTP server use…