I need to set the following rules:redirect www to non-www (close www)redirect http to https (close http)Suppose I have example.com , How to set the above rules together in htaccess?
non-www along with https
htaccess;https;no www
I solved this problem via :RewriteCond %{HTTP_HOST} ^(www\.example\.com)(:80)? [NC]RewriteRule ^(.*) https://example.com/$1 [R=301,L]RewriteCond %{SERVER_PORT} 80 [NC]RewriteRule ^(.*)$ https://example.com/$1 [R=301,L] 