Force non-www to www redirect

Hello,
I have a site with only a Discourse installation on it (don’t plan to have anything more than the forum).

Now I want to redirect the non-www domain to www.domain.it but also if I reconfigured Discourse via ./discourse-setup changing hostname to www.domain.it if I go to non-www I don’t get redirected but I get an SSL error (Chrome’s NET::ERR_CERT_COMMON_NAME_INVALID).

How I can resolve this?

I’m on a DigitalOcean Discourse Droplet with Discourse 2.2.0 beta1 on Ubuntu 18.04.

1 Like

If the request comes to http (not https) it works right now. It’s possible to search here and find some topics about having let’s encrypt support multiple domains.

The easy way is https://www.forcewww.com/

4 Likes

Now I noticed that http://domain.it redirects to https://www.domain.it but https://domain.it doesn’t.

Is there another way than forcewww?

1 Like

Can you please PM me with the name of your domain? forcewww should be redirecting https as well.

4 Likes