How to Redirect HTTPS non-www to HTTPS www
How to Redirect HTTPS non-www to HTTPS www using .htaccess
This code is tested on my own website sitesbay.com so you can try this code without any fear.
Redirect HTTPS non-www to HTTPS www using .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC,OR]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L,NE]
Advertisements