I want to redirect all my website pages to https and www. In order to do that I'm using the rules below and it's working fine.# Rewrite to WWW with HTTPSRewriteCond %{HTTPS} off# First rewrite to HTTPS# Don't put www. here. If it is already there it will be included, if not# the subsequent rule will catch it.RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]# Now, rewrite any request to the wrong domain to use www.# [NC] is a case-insensitive matchRewriteCond %{HTTP_HOST} !^www\. [NC]RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]However, Google PageSpeed Insights suggest me to avoid landing page redirects.Your page has 2 redirects. - https://developers.google.com/speed/docs/insights/AvoidRedirectsAny suggestion to do this in a better way?
Redirect to WWW with HTTPS optimization
htaccess;https;mod rewrite;google pagespeed