2

I have a domain that's been deployed via Heroku, and is up and running fine with the www. But if I go to the domain without the www, it does not render correctly. I tried adding both domains on Heroku, with www and without www, but unfortunately it still does not work.

Also, I tried following step two on here but continued to get an error: An unexpected error occurred. If this issue continues, contact support.

How can I add a naked domain to GoDaddy to forward to my web deployed on Heroku like my domain with www?

First Description GoDaddy (Only manually added the Heroku URL to CNAME www and Domain Forward to Heroku URL).

Second Description DNS Target set to Heroku URL and Domain on Heroku (Have one row for www and other without www).

  • Can you post an example of what you DNS settings look like?? – closetnoc Sep 20 '16 at 23:03
  • @closetnoc Sure thing, on GoDaddy or Heroku? – Ly Maneug Sep 21 '16 at 0:41
  • I am not sure how your domain is set up, so if it is set-up on GoDaddy, that is a starting place. For the record, I have no clue about Heroku. I did go to the site to see what web server was being used and somehow, I did not see it. If it is Apache, I may be able to help there too. At least, I can see what you can see and perhaps something will jump out at me. If I have not clue, then perhaps someone will. Cheers!! – closetnoc Sep 21 '16 at 0:44
  • @closetnoc Definitely. So stackexchange currently isn't allowing me to post images so I will just post the links here. Please refer back to the original post for descriptions. First description: i.stack.imgur.com/INXIO.png i.stack.imgur.com/y7OS7.png and Second description: i.stack.imgur.com/KMeEb.png i.stack.imgur.com/ol71G.png Images are cut off just to hide vital info. – Ly Maneug Sep 21 '16 at 1:17
  • Okay. The DNS looks okay at first blush. The rest I have no idea about. Have you call their tech support? – closetnoc Sep 21 '16 at 1:51
1

There are two ways. Either use URL forwarding or you can use a redirect in your .htaccess file. Try URL forwarding first.

URL Forwarding

To get this to work, go to the GoDaddy domain information and set forwarding to www.example.com.

.htaccess method

RewriteEngine on 
#if host ==domain.com
RewriteCond %{HTTP_HOST} ^domain\.com$
#and uri==/mypage
RewriteCond %{THE_REQUEST} /mypage
#redirect the request to http://app-heroku.com
RewriteRule ^(.*) http://app-heroku.com [P]

This will force people who do not use the non-www to the www.

Depending on your hosting (cpanel/plesk) Here are the steps. godaddy.com/help/redirect-urls-with-your-hosting-account-512‌​0

  • Appreciate the answer but are you referring to the root folder in GoDaddy/Heroku or my project itself? Sorry, just haven't heard anything like this before. Is this some type of a hack/work around? – Ly Maneug Sep 22 '16 at 7:04
  • Try the URL forwarding in Godaddy first. Then if that does not work I will help you with the htaccess. – norcal johnny Sep 22 '16 at 23:11
  • Sorry but could you guide me on how to do the forwarding? I believe I already have one set up for www Heroku on Godaddy – Ly Maneug Sep 23 '16 at 2:32
  • "I believe I already have one set up for www " that may also be why the non-www does not load right. But depending on your hosting (cpanel/plesk) Here is the steps. godaddy.com/help/redirect-urls-with-your-hosting-account-5120 – norcal johnny Sep 23 '16 at 2:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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