Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On heroku, is there absolutely no way to redirect an https naked domain on heroku to it's non naked domain with wwws?

Have a look at this link from the Heroku docs:

https://devcenter.heroku.com/articles/avoiding-naked-domains-dns-arecords#subdomain-redirection

The yellow boxes says:

Requests made directly to naked domains via SSL (i.e. https://mydomain.com) will encounter a warning when using subdomain redirection. This is expected and can be avoided by only circulating and publicizing the subdomain format of your secure URL.

Is that really the only solution? Just hope that people don't type in the url without the wwws?

I've had several problems with people just removing the sub-domain from the url to get to the homepage (on https) and encountering an ssl warning?

Has anyone else figured out a way around this?

like image 673
MintDeparture Avatar asked Sep 02 '12 14:09

MintDeparture


People also ask

How do I redirect a non www Heroku?

Go to the record editor and two DNS records, one for each host name, pointing to the Heroku SSL endpoint: Add an ALIAS record to point example.com to Heroku. Leave the Name of the record empty and set the Content field to the SSL endpoint example.com.herokudns.com. Add a CNAME record to point www.example.com to Heroku.

Is heroku a https?

Heroku SSL is a combination of features that enables SSL for all Heroku apps. Heroku SSL uses Server Name Indication (SNI), an extension of the widely supported TLS protocol.


1 Answers

The best idea we have found so far is to setup two Amazon EC2 micro machine instances with a small bit of nginx configuration. Then, provision two elastic IP addresses to point to those EC2 instances and point 2 A records to those IP addresses. This way, if something goes wrong on the hardware, you can always point your elastic IPs at another EC2 machine without waiting for DNS to propagate. Users going to https://example.com and http://example.com will get a 301 to the domain and no SSL warning.

server {   listen 80;   listen 443 default_server ssl;   server_name example.com;   ssl_certificate server.crt;   ssl_certificate_key server.key;   return 301 https://www.example.com$request_uri; } 

Another idea is to use the great service provided by wwwizer.

like image 157
maletor Avatar answered Sep 20 '22 05:09

maletor