I am attempting to redirect all traffic to Secure pages. I attempted an to try using either a PHP redirect, and an htaccess redirect. They worked, BUT, the problem is I get the following error:
"You attempted to reach domain.com, but instead you actually reached a server identifying itself as www.domain.com. This may be caused by a misconfiguration on the server or by something more serious. An attacker on your network could be trying to get you to visit a fake (and potentially harmful) version of domain.com."
We are the same domain. How do I go fixing the problem of the SSL certificate working for one domain but no the other domain?
You're getting that error because the SSL cert that you have seems to be for www.domain.com
and not domain.com
. You're not going to be able to avoid this if people attempt to go to https://domain.com
but you can canonicalize this using the same rule for redirecting to SSL:
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^ https://www.domain.com%{REQUEST_URI} [L,R=301]
See also: http://www.digicert.com/ssl-support/certificate-name-mismatch-error.htm