1
votes

I have a heroku app running at [myapp].herokuapp.com and I have a domain at [name].com through 1&1

I want my 1&1 domain to redirect to my heroku app, but I can't seem to get the CNAME right. Whenever I enter [myapp].heroukapp.com as my alias at 1&1, it says it's an invalid hostname. What can I do to fix this?

1

1 Answers

6
votes

What you want do to is this:

Create a CNAME for:

www.yourdomain.com -> myapp.herokuapp.com

Then forward all requests from your root domain:

yourdomain.com -> www.yourdomain.com

This way, any user who visits yourdomain.com will be redirected to www.yourdomain.com (a cname for your heroku app), and any user who visits www.yourdomain.com will render your heroku app using the cname record directly.