I'm trying to make my url without www redirect to www and my url without https redirect to https in the minimum of possible redirects.
I'm using this rule
# BEGIN SSL Redirect
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
# END SSL Redirect
the problem is that this rule generates many redirects if I try to access this url
example.com
do it
http://example.com/ ==> http://www.example.com/ ==> https://www.example.com/
I would like you to do this