http To Https & redirect it to WWW simple Code

Options -MultiViews
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^xyz.com$ [NC]
RewriteRule (.*) https://www.xyz.com/$1 [R=301,L] 

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.xyz.com/$1 [R,L]

Leave a Reply

Your email address will not be published. Required fields are marked *