Wordpress - support www redirection?

I’ve just installed the Wordpress app on my NS8 system, and it works great–set up the domain, it got the cert, set up Wordpress itself, working on the site. Cool. But…

My site is set up on the root of a newly-registered domain. www in a server name isn’t necessary, and hasn’t been for a good many years, but some people still enter it, seemingly by reflex. So, is it possible to configure this app to (1) get a cert for www.domain along with domain, and (2) automatically redirect www.domain to domain? If not, any chance of updating the app to allow for this?

If there’s an update, I’d suggest it allow the user/admin to specify the canonical FQDN for the site (www, base domain, or even something else), and then one or more additional FQDNs to redirect to the canonical name. It should then, I’d think, get a single cert covering all the FQDNs, and handle the redirects.

I’m aware of a workaround, though it’s distinctly suboptimal: set up a virtual host using the web server app for the alias (www.domain in my case), and drop in an index.html to redirect to domain. But it’d be very much nicer to handle this all within the Wordpress app.

Edit: for future reference, this HTML does the job. But I’d still like it to be part of the Wordpress app:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="refresh" content="0; url=https://dcbrown.law" />
    <script>
      // Extra reliability: JS redirect in case meta refresh is blocked
      location.replace("https://dcbrown.law");
    </script>
  </head>
  <body></body>
</html>

You could setup an HTTP route which also allows to get an LE cert.
Check the URL of the original wordpress route, in my case http://localhost:20016 and copy the route like:

i am now thinking, the redirect tool could use some improvements, where we can select an installed app, as alternative to adding ip:port manually

That’d be a cleaner, GUI way to do it, compared to my method. What it doesn’t do, though, is redirect from the one FQDN to the other. Since Wordpress expects its own FQDN, I’m wondering if that would cause trouble/confusion.

I think it’s no problem. Not Wordpress but Traefik expects a FQDN. As we add a traefik route covering the www. prefix, Wordpress should just come up with the set FQDN. (without www)