Hi guys, I want to know how can I enable “www” (https://www.mydomain.com), but keep mydomain.com as primary hostname. I mean, redirecting from “www” to non-“www”, using let’s encrypt.
I found a guide about install nginx after to install discourse from docker, but I’m very noobie, so can anyone help me and explain me all steps. My forum is empty so no problem to reinstall everything if it’s necessary.
I’m pretty sure that wasn’t what he was asking at all @pfaffman … he was asking “how do I automatically redirect visitors to the non-www version of my domain”.
example.com www.example.com
This is most easily done via the DNS controls where you purchased your domain name from. If your DNS provider doesn’t support redirection, you’re stuck implementing redirects in your webserver.
If he points both domains to his Discourse server and he has https on his site he’s fine as long as people hit the http version. Then it’ll do the redirect to https://example.com as desired.
If what he wants is also to have https://www.example.com to redirect to the bare domain, then the instructions I link to provide at least a hint of how to accomplish that. (I’m pretty sure that I did that recently.)
Why not just set up a redirect? There’s no value in having your instance published under two discrete fqdn.
Get your domain off of digitaloceans DNS, and use your domain registrar’s tools to redirect any additional subdomains to the main URL. This doesn’t need to touch your discourse install at all.