Skip to main content

Hatchbox: How do I point a Godaddy Domain to a wildcard sub-domain?

Servers • Asked by Arjun Rajkumar

I run my app on Hatchbox, and have successfully created subdomains for each user.
E.g.
user1.myapp.com
user2.myapp.com
user3.myapp.com
etc.
How do I point user 2's own website (two.com) to user2.myapp.com?

This is what I did:

1) On Godaddy DNS settings under two.com account, I added a CNAME with name 'community' and value 'user2.myapp.com'
So I thought when I visit 'community.two.com' it should display 'user2.myapp.com'.
But, instead it is displaying myapp.com.

Is there something I should add to the NGINX file on Hatchbox - saying 'community.two.com' and 'user2.myapp.com' are connected.

I remember when I was using Heroku - I had to add the domains on Heroku also. Just wondering how to fix this.

Any advice will be really helpful!

Thanks

Arjun


Solved. Got help from Chris via email.

If anyone is stuck on this --
"
A CNAME just tells your browser which server to talk to. You'll have to write the code in Rails to check the domain to see if it's yours or a customer's in addition to checking the subdomain. You'll want to check the domain first, if it's a customers' look up their account. If it's yours, look at the subdomain, then lookup the account.
"


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.