I have an Apache CentOS (latest) site with subdomains, I want normal users using http and when using the shopping cart to use https; I use non-www, so I want to redirect all www to the non-www url as below; now the problem I'm having is the https ssl url; I have a single ssl cert (not a wild card) so I need all www to redirect to the non-www; but I get the page "This Connection is Untrusted", forcing users to except this cert or exit; after you except it, it will do the redirect; but not before, how can I fix this so they do not get that page?
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]