My problem is when I type example.com
or www.example.com
in browser it redirect to https://example.com
but when I type https://www.example.com
, it doesn't redirect to https://example.com
.
I want whatever may be the url http or https and www or non www, it always point to https://example.com
.
I have used below url rewrite for htaccess file.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]
Thanks in advance.