Setup a custom domain for your appfog application

www
On a previous post we saw how to deploy a PHP application in appfog using appfog CLI. appfog gives you a domain for your newly created aaplication which is not so beautiful at all. Such as (http://YOUR-APP-NAME.aws.af.cm/) or something like that according to your choosen region/infrastructure while creating the app.

Today we will point a godaddy domain to a appfog application. For this you will have to first go to your app under your appfog account. Then select the Domain Names from left navigation. Here you can see the domain name already assigned to your application and few more blank fields for domain names to be added.

Also you can see the DNS instructions for custom domains” below that form. Here it will show what “A” record and CNAME record you should add on your own domain control panel.

Screen Shot 2013-02-14 at 7.24.46 PM

I have added www.nuhil.net as the second domain name. Then I added a “A” record and a “CNAME” record under my godaddy domain management panel using the DNS manager.

godaddyIf you wait few hours after changing the records in your domain end, then this will point the full domain for example http://www.nuhil.net to the appfog application but if you type the naked one like, http://nuhil.net then it will show a 404 not found appfog message. For the solution I did a forwarding under my godaddy account using the “forwarding domain tool” to forward the naked domain to full domain.

Screen Shot 2013-02-14 at 7.39.38 PM

This forwarding may cause a change on your “A” record you just created manually according to appfog’s suggestion. But no need to worry. The “CNAME” can take care of all the rest.