I have a multi site where the sub pages should redirect from non-www to www.
RewriteCond %{HTTP_HOST} ^example\.com$
RewriteRule ^/?$ "https\:\/\/www.example\.com" [R=301,L]
This code above works if you enter https://example.com
, then you are forwarded to https://www.example.com
. But if you go directly to a subpage such as https://example.com/about
, then you aren't redirected to https://www.example.com/about
.
How do I write the redirect to fix this?
I have tried different redirects but I can't get them to work.