简体   繁体   中英

SSL at the root domain on heroku

I've got a website with an SSL certificate for the root domain only - example.com.au

The site runs on heroku with the dns at dnsimple.com

I want all requests to www.example.com.au to go to the canonical url, ie to example.com.au and obviously this redirection needs to be set up at the dns level so that the user doesn't get stopped with an "insecure" message.

What should i put in my DNS?

I want all requests to www.example.com.au to go to the canonical url, ie to example.com.au and obviously this redirection needs to be set up at the dns level so that the user doesn't get stopped with an "insecure" message.

In short: This is not possible, because aliases at DNS level will not change the hostname.

In detail: If the user types in www.example.com the client (ie the browser) will lookup the IP for this host and it will follow any DNS aliases (like a CNAME pointing to example.com ) during this process. But, following DNS aliases will not cause redirects inside the browser. Instead the name in the URL will stay the same and so will be the name used to verify the certificate. This means there is no way to do what you want at the DNS level. If you want to redirect from https://www.example.com to https://example.com you must have a certificate matching www.example.com .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM