0

I have a website with the ssl for www.example.com. I have set up a htaccess redirect which redirects the user from http://example.com => http://www.example.com. If I enter https://www.example.com then it works. But if I enter https://example.com then it gives me a ssl error.

How do I redirect https://example.com to https://www.example.com without showing the ssl error?

I use the following code in my htaccess to redirect.

RewriteCond %{HTTP_HOST} !^www\.

RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
4

1 回答 1

2

这与您的 SSL 设置有关,如果 (www.domain.com) 没有发出任何错误,则可能没有为 (*.domain.com) 设置。

www.domain.com != domain.com

因为www是重定向到 ( domain.com) 的子域,所以您需要按照@Jack 的建议为 ( *.domain.com) 或仅为 ( ) 启用 SSLwww.domain.com

于 2013-09-19T05:37:30.663 回答