I've been using Heroku to host and manage a website of mine that requires an SSL certificate. For the last year and a half I've been using ZerigoDNS to manage my domain and SSL redirecting (although, redirecting from non-https, non-www to https and www does not work).
I just got a notice from Heroku that they will be shutting down ZerigoDNS soon and they recommend switching to PointDNS. I couldn't find any information in the PointDNS documentation about managing SSL redirects.
Here's what I'm looking to do:
non-www non-https redirects to https and www
non-https redirects to https and www
https but non-www redirects to https and www
The reason everything needs to be forwarded to https and www is that's what the ssl cert was created for (the www is required. I don't have a wildcard certificate).
Does anyone familiar with PointDNS know how to to set up the records and redirects properly?
Thanks in advance!
Regarding non-www to www redirects, I just got that to work as follows:
First, you must add both
www.your-domain.com
andyour-domain.com
as custom domains.heroku domains:add andrewpuglionesi.com heroku domains:add www.andrewpuglionesi.com
I have a CNAME record with name
www.my-domain.com.
. The text in its data field ismy-heroku-domain.herokuapp.com.
I also have an alias record with the namemy-domain.com.
, and I made its data fieldwww.my-domain.com.
In other words, the alias just points to the CNAME.I don't know if this is well-advised, but it seems to work (and without sticking
www
in the user's URL, at that). It simply solves the problem where you can't access pages other than the index without havingwww
there). I like how Heroku and PointDNS' documentation both say you can easily do redirects and then don't actually explain how to... I guess this is one way.I've previously been able to force https protocol through the backend of a Django site. I can't remember the exact method I used, but you might be able to do it without the DNS stuff.