Hello Community,
I recently installed Flarum in a VPS along with apache2 and a letencrypt certificate. I was able to successfuly redirect all my http traffic to https eg http://example.com is redirected to https://example.com and http://www.example.com to https://www.example.com. I however desire to serve my website on only https://www.example.com to avoid duplicating my content which would halve my search rank potential. If I can find a way to redirect https://example.com to https://www.example.com. But i've searched and anything I have tried either resulted in ERR_TOO_MANY_REDIRECTS or did not work at all. My apache config currently includes the following values:
RewriteEngine on
RewriteCond %{SERVER_NAME} = www.example.com
RewriteCond %{SERVER_NAME} = example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
my config.php has the www.example.com as the url value. Is there a way I could achieve my goal within the apache configs? if its not possible within apache i'll appreciate whatever else works.