These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for Rewrite www to non www under sub vhost on the new forum.
Under main domain I have set redirect which works fine (domain.com):
RewriteEngine On RewriteCond %{HTTP_HOST} ^www.(.)$ [NC] RewriteRule ^/(.)$ https://%1/$1 [R=301,L]
However it does not work for sub servers (sub.domain.com) and I don't know why.
Under Virtualmin config I have also set redirect http to https
Thanks,