My Drupal 8 site only works with www. but without it I'm getting a WSOD with the "The provided host name is not valid for this server" error.
I've tried to implement the suggestions from this thread: What does "The provided host name is not valid for this server" mean?
Specifically I tried:
$settings['trusted_host_patterns'] = array(
'^www\.example\.com$',
'^example\.com$'
);
$settings['trusted_host_patterns'] = [];
$settings['trusted_host_patterns'] = [ '.*' ];
Still, site will only work with www