Redirectong all requests to the root domain through https in Trellis

Hello,

I’ve been now trying to make vhosts in Trellis redirect all requests to the root domain through the https protocol:

www.domain.com -> https://domain.com
domain.com -> https://domain.com
https://www.domain.com -> https://domain.com

Is that possible to do at all ? It seems possible to redirect plain domain to https, but I cannot make the configuration handle redirecting www requests. Dos this require some manual changes to vhost template files in Trellis. I thought that If I configure my site like so with https enabled:

  domain.com:
    site_hosts:
      - domain.com

The config should handle www and https: //www… . Unfortunately, this is not the case.

I’d appreciate advice and perhaps an example of your configuration if you managed to achieve this. Thank you!

I’ve been now trying to make vhosts in Trellis redirect all requests to the root domain through the https protocol…

How have you been trying to do that?

By default, Trellis should work that way. Have you read this thread? Https://www Unsecure and Not Redirecting