Primary Domains Auto-redirects to Sub-Domain (Digital Ocean Droplet)

AI-generated summary

Saahir_Foux is setting up Discourse on a DigitalOcean droplet and reports that the primary domain (example.com) automatically redirects to the subdomain (community.example.com). Additionally, the Let’s Encrypt SSL certificate only covers the subdomain and expires in May 2020. omarfilip suggests checking the DNS configuration for a CNAME record causing the redirect and notes that Let’s Encrypt certificates auto-renew when installed via the official guide. They also provide a link to DigitalOcean’s Let’s Encrypt guides for adding SSL to the primary domain. pfaffman recommends using forcewww.com if the apex domain should point to www, and reassures that Let’s Encrypt certificates auto-renew — no manual extension is needed. For more details, users are directed to letsencrypt.org.

I am in the process of setting up discourse on my new droplet, and for some reason the prime domain .example.com automatically redirects to the subdomain community.example.com

The primary domain is also not covered by the letsencrypt ssl certificate, while the sub-domain is.

Also, the ssl cert is only valid through 5/2020. How can this be extended? If there is any guides anyone can point me to that would explain a solution for the redirect, explain adding the same ssl for the prime domain, and how to substantially extend the validity of the ssl cert, I would be very grateful.

Check your DNS file to make sure you don’t have a CNAME record that redirects example.com to community.example.com.

If you are using the official install guide with a Let’s Encrypt SSL certificate, it is set up to auto-renew.

As for installing an SSL certificate for the primary domain, here are some example guides:

If you want I have your apex (bare) domain point to www see forcewww.com.

Your https certificate is automatically renewed. You don’t need to worry about it. See letsencrypt.org for more info.