Currently, I have a website (example.com). http to https redirect is working via my .htaccess file
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
This website also runs on subdomains.
If someone goes to www.subdomain.example.com of the website, I want them to be redirected to https://subdomain.example.com.
Is it possible to achieve this with the htaccess file without impacting the http to https redirect that I have working for example.com?
Thanks!