<IfModule mod_rewrite.c> .... .... # Redirect To HTTPS RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} ^www. [NC] RewriteRule ^ https://example.com%{REQUEST_URI} [L,NE,R=301] ... ... </IfModule>