http to https redirect rule RewriteCond %{SERVER_PORT} ^443$ [OR] RewriteCond %{HTTPS} on RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] http to https and non www to www # Redirect to www RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
i will write here as per my knowledge, and what i have done in practical, i like to make easy solution for all tech and non techky