I tried 12 different solutions on this forum and non of them will work. I want all my domains to have https://www.
Now i am using this:
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://www.%{HTTP_HOST}%{REQUEST_URI}
But now when i go to www.example.com it redirects to https://www.www.example.com (twice www.)
http://example.com works perfect it redirects to https://www.example.com
You can use the following rule to redirect to https://www
That's a normal behaviour.
Actually, you'll need to check if
www
is in the host or not before doing a redirect.An easy way would be to split the problem in two conditions