# Redirect non-www to www.mydomain.com

**URL:** https://meta.discourse.org/t/redirect-non-www-to-www-mydomain-com/107037
**Category:** Support
**Created:** [20 januari 2019 om 19:43 UTC](https://meta.discourse.org/t/redirect-non-www-to-www-mydomain-com/107037 "2019-01-20T19:43:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![foros](https://avatars.discourse-cdn.com/v4/letter/f/db5fbb/32.png) [@foros](https://meta.discourse.org/u/foros)
#### Post date: [20 januari 2019 om 19:43 UTC](https://meta.discourse.org/t/redirect-non-www-to-www-mydomain-com/107037/1 "2019-01-20T19:43:08Z")

</div>

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

---

<div class="post-metadata">

### Author: ![foros](https://avatars.discourse-cdn.com/v4/letter/f/db5fbb/32.png) [@foros](https://meta.discourse.org/u/foros)
#### Post date: [20 januari 2019 om 20:52 UTC](https://meta.discourse.org/t/redirect-non-www-to-www-mydomain-com/107037/2 "2019-01-20T20:52:32Z")

</div>

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`

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [21 januari 2019 om 04:34 UTC](https://meta.discourse.org/t/redirect-non-www-to-www-mydomain-com/107037/3 "2019-01-21T04:34:12Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![foros](https://avatars.discourse-cdn.com/v4/letter/f/db5fbb/32.png) [@foros](https://meta.discourse.org/u/foros)
#### Post date: [21 januari 2019 om 21:30 UTC](https://meta.discourse.org/t/redirect-non-www-to-www-mydomain-com/107037/4 "2019-01-21T21:30:47Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [17 januari 2022 om 16:26 UTC](https://meta.discourse.org/t/redirect-non-www-to-www-mydomain-com/107037/5 "2022-01-17T16:26:19Z")

</div>


