3

I have an App hosted on Heroku, Domain and DNS Target is <appname>.herokuapp.com, as usual.

My 1and1 Domain <domain>.net is set up to HTTP-redirect to www.<domain>.net. I added the www subdomain which has the CNAME Alias <appname>.herokuapp.com.

This should work, at least i've read about this "workaround" in several threads on Stackoverflow / Webmasters.

However, accessing either <domain>.net or www.<domain>.net leads to a "Too many Redirects" error.

There are no .htaccess files on the entire associated 1and1 webspace if that matters. The Heroku app is written in Node.js and works fine when accessed via the Heroku Domain. How can i resolve this?

Edit:

These are the DNS Settings:

Root - <domain>.net

Nameserver: 1&1 Nameserver (Default) A/AAAA Entry (Ip address): 1&1 IP-Address (Default)

Subdomain - www.<domain>.net

DNS Settings: CNAME - Alias: <appname>.herokuapp.com

2
  • Can you show us the DNS settings for <domain>.net and www.<domain>.net? Copy and paste.
    – Steve
    Jun 12, 2015 at 11:19
  • @Steve Added them
    – user53213
    Jun 12, 2015 at 12:40

1 Answer 1

2

The < appname >.herokuapp.com target is doing virtualhosting (hosting multiple domains on one IP) and your space is configured to serve requests for < appname >.herokuapp.com but since you made a CNAME of www.< domain >.net pointing to it, the target is getting a request for www.< domain >.net and unless the target is specifically configured to do something for that hostname, it will not work as expected.

1
  • handle www.domain.net yourself (why not the same space as domain.net) and make both redirect to appname.herokuapp.com.If your aim is to have your own url visible in the addressbar instead of the herokuapp one, then, unless you can get them to handle your virtualhostname, I see no solution but have the herokuapp page it in a (fullpage) frame, which I don't find very clean.
    – multia
    Jun 12, 2015 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.