I need to do the following: My current address looks like: https://www.domain.com
I want to redirect with htaccess: www.domain.com TO https://www.domain.com and http:/
The best way is:
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
With using %{HTTP_HOST} you don't need to write domain name
%{HTTP_HOST}