I know this question has been asked
Domain doesn't work without www
But I need a solution for node.js app hosted on heroku and using namecheap with komodo
Also, I found this similar thing which i didnt' understand at all.
Can someone give an example of how to handle this in node.js?
Details: I'm using express. In Heroku I have
example.me(Domain Name) yamanashi-3938.herokussl.com (DNS Target)
www.example.me(Domain Name) yamanashi-3938.herokussl.com(DNS Target)
In Namecheap I have:
@ | https://www.example.me | URL redirect
www | yamanashi-3938.herokussl.com. | CNAME
www.example.com
and example.com
are different records in the DNS. You need to make sure both are pointing to the same place. You can either set both to point to the same address or setup the example.com
to redirect to the www.example.com
.
If you're using namecheap it should look something like this.
+------------+---------------------------+--------------+
| Host Name | IP Address/URL | Record Type |
+------------+---------------------------+--------------+
| @ | http://www.yourdomain.com | URL Redirect |
| www | app-name.herokuapp.com. | CNAME(Alias) |
+------------+---------------------------+--------------+
Make sure you also add the domain under your Heroku project settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With