I recently set up a new site (hikethecanyon.org) on the Google App Engine running OpenBlueDragon. By default when you set up a new site on GAE (Google App Engine), you choose an ID for your application, which must be unique on their system as it also serves as the hostname of the URL like this: http://[your ID].appspot.com. For those that would like to use a different domain name, Google App Engine has mechanisms for doing so. In the administration panel of your application, you can add a domain and then choose hostnames from that domain that the application should respond to. However, it makes no provisions for serving the “naked domain”.
What does this mean? For my example of hikethecanyon.org, I originally set the site up with an id of hikethecanyon-org which was initially served as http://hikethecanyon-org.appspot.com. After adding the domain hikethecanyon.org, I was able to add the host “www” so that it would respond to http://www.hikethecanyon.org. However, since GAE doesn’t support naked domains, I was unable to set it up to respond to http://hikethecanyon.org. I was able find a workaround using GoDaddy’s domain forwarding functionality. While walking fellow CFML developer Paul Kukiel through the process today, he mentioned that someone should blog this, so here it is with screenshots along the way (edit – it appears that he decided to blog it himself as well!)
For my example, I am going to use a domain I have had sitting around doing nothing for a few years (j4n.org) and walk through the process with some screenshots and explanations along the way.
First, you need to create your application in the GAE dashboard and deploy your application. Many people have covered this topic in our community including Paul Kukiel and Aaron Lynch, so I will skip to the next step and assume that you have a running application on Google App Engine. As you can see below, I have set up an app with an ID of j4n-org that is answering on http://j4n-org.appspot.com which is just running a Mach-II skeleton application.
The next thing that we want to do is add the j4n.org domain to this application. When you go into the GAE dashboard, you will see that option under the “Application Settings” section labeled “Domain Setup”
On this page you will see a note that tells you that the domain you add must be set up for Google Apps, a service that allows all sorts of functionality, including email services and more. NOTE: You do not have to use any of those services, you simply need to sign up!
By clicking the link that says Sign up for Google Apps, you will be taken to a page like this:
Walk through the process filling out your personal information and you will come to a screen that looks like this:
For our example, we are going to choose to create a new CNAME record in DNS to prove to Google that we own the domain. By choosing that option
At this point we need to go to the GoDaddy DNS manager and create a host name google46353a9a2d07a035 and point it to google.com. You can see what that looks like below:
Once that record is in place we can go back to the Google Apps page and click the button labeled I’ve completed the steps above. If all goes well, you will see a page directing you through additional setup. For our purposes in this example, we are done with Google Apps for the time being. Now we want to go back to the GAE dashboard and tell it that we want to use the j4n.org domain.
When you enter that domain you should see a message that looks like this:
This will bring us back into the Google Apps control panel for the j4n.org domain and we can add hostnames to our application like this:
When you click add you will see an page like the one below instructing you to add another CNAME to GoDaddy for the host “www”.
In the screen below you will see that we have successfully added the “www” host and while we were in there I went ahead and deleted the temporary CNAME that we had to create earlier to validate the ownership of the domain.
At this point we can actually reach our application with the address http://www.j4n.org as you see below:
While this is pretty cool and all, we still can’t access our application with http://j4n.org. For this, we will count on GoDaddy to do the rest. Go back into the GoDaddy domain manager look for this link:
On the next page, you will want to fill out the field like you see before. However, before you do, click the “learn more” link in the bottom left corner. On that page there is a very important note: For your domain to forward, your domain’s A record must be
. If you note my DNS information above, that is not what the default parked domain IP is. I won’t bore you with yet another screen shot, but make sure you alter your domain’s A record. Now when we ping j4n.org we get a response from 220.127.116.11.
Once we enter in www.j4n.org you can see that our plan is going to work by hitting the “Preview” link to the right and seeing a snapshot of our app!
You will notice that we accepted the default settings which actually does a 301 redirect from http://j4n.org to http://www.j4n.org. This means that we will never actually see http://j4n.org in the address bar after the page has loaded. If you click on the advanced settings you can select “masking” which allows the url to remain in the address bar as http://j4n.org. Each option has its own advantages. Select what is right for your application and choose OK.
That is all you need to do! Now, a word of warning… we have all gotten spoiled by the seemingly instant DNS changes in recent years. You will find that when you make this forwarding change, you may need to wait up to half an hour or so before you can see the finished product (your mileage may vary).