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]
Code Hub: Just copy and paste
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]