I have a problem with my bitnami wordpress hosted on Google cloud. I have both the www and the non-www version running in parallel. I want to have all the non-www traffic 301 to the www version.
I added these lines into the conf file:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://example.com/$1 [L,R=301]
But it does not fix the issue. Anyone has a solution?