@ Top-level domain redirects to www

  1. Temporarily elevate privileges using sudo to edit app.yml
sudo nano /var/discourse/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:

DISCOURSE_HOSTNAME: 'www.discourse.cc'      # Your main domain (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 using root privileges:
cd /var/discoursesudo ./launcher rebuild app