I'm trying to redirect all https://example.com to https://www.example.com and I can't find anything that works. I want to do this as I think it will look better and it will make logging in easier as you currently have to login at both domains as they're treated as being different. I added this .htaccess file in case this is what I've got wrong?
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]