example.com , now what I need is request comes to example.com and www.example.com redirect to https://www.example.com,
This is my apache redirect code
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ https://www.example.com$1 [R=301,L]
If I add RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
browser says too many redirects or redirect loop, how to solve this, I have sub domain configuration also so the condition not to affect subdomain redirects...