# @ Top-level domain redirects to www

**URL:** https://meta.discourse.org/t/www/400583
**Category:** Sysadmins
**Created:** [April 14, 2026, 6:50am UTC](https://meta.discourse.org/t/www/400583 "2026-04-14T06:50:44Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Lxk520](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lxk520/32/550353_2.png) [@Lxk520](https://meta.discourse.org/u/Lxk520)
#### Post date: [April 14, 2026, 6:50am UTC](https://meta.discourse.org/t/www/400583/1 "2026-04-14T06:50:45Z")

</div>

1. Use `sudo` to temporarily elevate privileges and edit app.yml

```sh
cd /var/discourse
sudo nano /containers/app.yml

```

1. Edit the Discourse configuration file `app.yml`

You only need to configure the main domain and alias relationships in the Discourse configuration file `app.yml`:

```plaintext
DISCOURSE_HOSTNAME: 'www.discourse.cc' # Your main domain (the final access address)
DISCOURSE_HOSTNAME_ALIASES: 'discourse.cc' # Other aliases, which will automatically redirect to the main domain

```

> **Please note** : `DISCOURSE_HOSTNAME` should be followed by the “main domain” you want users to ultimately access, while `DISCOURSE_HOSTNAME_ALIASES` should contain the “aliases” you want to redirect to the main domain.  
> After editing, save the file (`Ctrl+O`, Enter, `Ctrl+X` to exit).

1. Finally, rebuild with root privileges:

```sh
sudo ./launcher rebuild app

```

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [April 14, 2026, 3:16pm UTC](https://meta.discourse.org/t/www/400583/2 "2026-04-14T15:16:32Z")

</div>

> [@Lxk520](#):
>
> Use `sudo` to temporarily elevate privileges and edit app.yml

This is usually unnecessary on a [standard install](https://meta.discourse.org/t/142537?silent=true) because you log in as root

---

<div class="post-metadata">

### Author: ![Lxk520](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lxk520/32/550353_2.png) [@Lxk520](https://meta.discourse.org/u/Lxk520)
#### Post date: [April 14, 2026, 3:33pm UTC](https://meta.discourse.org/t/www/400583/3 "2026-04-14T15:33:36Z")

</div>

I didn’t quite understand what you meant. Could you please explain it again?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 14, 2026, 3:49pm UTC](https://meta.discourse.org/t/www/400583/4 "2026-04-14T15:49:55Z")

</div>

[Standard install](https://meta.discourse.org/t/142537?silent=true) just requires that you be root to run the scripts. It’s really best practice to disallow root logins. Digital ocean enables them by default since it’s just easier. Disallowing password login for root is almost as good as requiring login as another user.

If you’re going to use the machine for any purpose other than administration (unusual for a server) then you definitely want another user.

---

<div class="post-metadata">

### Author: ![Lxk520](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lxk520/32/550353_2.png) [@Lxk520](https://meta.discourse.org/u/Lxk520)
#### Post date: [April 14, 2026, 4:45pm UTC](https://meta.discourse.org/t/www/400583/5 "2026-04-14T16:45:56Z")

</div>

Root login is disabled. How can this be implemented if needed?

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [April 14, 2026, 6:19pm UTC](https://meta.discourse.org/t/www/400583/6 "2026-04-14T18:19:59Z")

</div>

> [@Lxk520](#):
>
> Root login is disabled.

And that’s probably good practice in the long run as @pfaffman pointed out.

My point is on the [standard install](https://meta.discourse.org/t/142537?silent=true), the standard login approach is via root, so sudo is unnecessary.

The major point here is that instructions for “non standard” (if more secure) installs might be confusing to some:

- “why do I suddenly need sudo?”.

But sure, logging in with least privileges is good practice.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 16, 2026, 6:04pm UTC](https://meta.discourse.org/t/www/400583/7 "2026-04-16T18:04:50Z")

</div>

> [@merefield](#):
>
> My point is on the [standard install](https://meta.discourse.org/t/142537?silent=true), the standard login approach is via root, so sudo is unnecessary.

My point is that the [standard install](https://meta.discourse.org/t/142537?silent=true) requires that you be root, but is agnostic on how you become root.

> [@merefield](#):
>
> The major point here is that instructions for “non standard” (if more secure) installs might be confusing to some

Oh. I see. So your argument is really that “all the other docs don’t discuss how you become root” so we don’t need to do that here. I can agree with that.

So it makes sense to edit the OP and delete this pedantic discussion. 🙂
