I have browsed through various forums in search of an answer to this:
I need https://www.domain.com to redirect to https://domain.com. Reason being, the cert is only valid for https://domain.com and not https://www.domain.com
This rewrite rule works fine to redirect:
==
rewriteEngine on
rewriteCond %{HTTP_HOST} !^domain\.com
rewriterule (.*) https://domain.com/$1 [R=301,L]
==
Only one problem. I still get prompted that the SSL cert is invalid for https://www.domain.com, and only after I accept the certificate in it's invalid state do I get redirected to https://domain.com. I have tried using this rewrite rule in .htaccess and the virtual host directive for 443 within httpd.conf. No luck.
My goal is to have https://www.domain.com redirected to https://domain.com before the cert prompt.
Note: The SSL-domain logs no longer show https://www.domain.com being accessed, but rather https://domain.com after the rewrite. Yet, still no success with redirecting before the cert check takes place.
Any suggestions?