SSL证书没有WWW阿帕奇(ModRewrite)EV [英] SSL Certificate no WWW Apache (ModRewrite) EV
问题描述
ModRewrite可以轻松处理剥离WWW过我的域名的前面。
在.htaccess:
ModRewrite can easily handle stripping the www off the front of my domain.
In .htaccess:
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
但随着SSL的证书检查来了的.htaccess重写之前,导致证书错误。
我宁愿不买为WWW SSL证书只重定向它。
你能不能给我一个更聪明的解决方案吗?
(顺便说一句EV证书不能作为通配符)
But with SSL, the certificate check comes before the .htaccess rewrite, causing certificate error.
I would rather not buy an SSL certificate for the www only to redirect it.
Can you offer me a smarter solution?
(btw EV Certificates are not available as wildcards)
推荐答案
您可以在其中多个域名证书。获取一个与 mydomain.com
和 www.mydomain.com
。我想这也有可能买到使用通配符证书,这将匹配任何子,但他们花费更多。
You can get certificates with multiple domain names in them. Get one with mydomain.com
and www.mydomain.com
. I think it's also possible to buy "wildcard" certificates that will match any subdomain, but they cost much more.
这篇关于SSL证书没有WWW阿帕奇(ModRewrite)EV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!