we have a url for eg https://www.egdomain.com/
and the ssl is valid for egdomain.com.
so how can i redirect all the requests from https://www.egdomain.com/
to https://egdomain.com/
the site also has normal http requests which works fine.
I tried the htaccess below but still nothing
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteCond %{HTTP_PORT} =443
RewriteRule (.*) https://%1/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule (.*) http://%1/$1 [L,R=301]
Any help will e much appreciated