I added domains to my heroku project:
$ heroku domains
=== diveintoworld Heroku Domain
diveintoworld.herokuapp.com
=== diveintoworld Custom Domains
Domain Name DNS Target
───────────────────── ───────────────────────────
diveintoworld.com diveintoworld.herokuapp.com
www.diveintoworld.com diveintoworld.herokuapp.com
$ host www.diveintoworld.com
www.diveintoworld.com is an alias for diveintoworld.herokuapp.com.
Created CNAME
record in my domain settings:
www.diveintoworld.com. CNAME diveintoworld.herokuapp.com.
And set up web redirect from diveintoworld.com
to www.diveintoworld.com
.
Seems like nothing was missed but all these things work like redirect.www.diveintoworld.com->diveintoworld.herokuapp.com
But I need to make my site available under www.diveintoworld.com
. (When user see my site he should see this url rather than heroku url in his address line.)
When I run
curl -s -I www.diveintoworld.com
It returns a 301. Which means that your app might be doing the unexpected redirect.
HTTP/1.1 301 Moved Permanently
Server: Cowboy
Connection: keep-alive
X-Powered-By: Express
Location: https://diveintoworld.herokuapp.com/
Vary: Accept, Accept-Encoding
Content-Type: text/plain; charset=utf-8
Content-Length: 70
Date: Thu, 21 Apr 2016 05:34:24 GMT
Via: 1.1 vegur
X-Powered-By: Express
is from the express.js
framework which I'm assuming is the one you used to develop your website. Do you have somewhere in your app code a redirect to the heroku url? Perhaps an environment specific config that sets the app host?
UPDATE - SOLVED
The problem was a misconfiguration of the HEROKU_URL
in the configuration of the app. In this case the Ghost platform was used and the config documentation for the url is available here.
Setting HEROKU_URL
with http://www.diveintoworld.com
, clearing cache or trying in private tab did the trick.
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