Redirect non-www to www.mydomain.com

Hi,

So, I have Ubuntu 18.04. I did not install any web server (as far as I know). All I want to do is to tell the web browser that when someone type my website like forosdeinmigracion.com, the URL box should show https://www.forosdeinmigracion.com.

How can I do that in Discourse?

Johnny

1 Like

Never mind. I just added the www to the domain in app.yml on DISCOURSE_HOSTNAME: www.mydomain.com and it worked. Now the site is directing to www.mydomain.com

Generally you redirect using your DNS controls, so have the apex domain example.com redirect to www.example.com.

We don’t recommend putting Discourse at the root unless you’re absolutely certain you will never have any other content on your website.

3 Likes

Hi Jeff,

I tried DNS but I guess the change was going to populate the net. I did use the app.yml to make it happen and I am happy with it. I am not planing to have other contents in my server.

Thanks for the input.

Johnny

1 Like