I have more versions of redirect
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.matrafox.info/$1 [R,L]
Other version is
#non-www. http to www. https
RewriteCond %{ENV:HTTPS} !on
RewriteCond %{HTTP_HOST} ^(www.)?matrafox.info$
RewriteRule (.*) https://www.matrafox.info/$1 [R=301,L]
#non-www. https to www. https
RewriteCond %{ENV:HTTPS} on
RewriteCond %{HTTP_HOST} ^matrafox.info$
RewriteRule (.*) https://www.matrafox.info/$1 [R=301,L]
Other version is
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^ https://www.example.com%{REQUEST_URI} [NC,L,R=301,NE]
Another one :
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]