我环顾四周,但似乎无法找到确定的解决方案.我们的域名访问者中有少数人或我们的访问者有一个小问题:
I have looked around and I can't seem to find a definitive solution for this. We are having a small problem with a few or our visitors that are typing in our domain as such:
www.example-这是一个安全警告此网站的安全证书有问题."
www.example - This is giving a security warning "There is a problem with this website's security certificate."
我们为example
因此,如果有人输入www.example或www.example,它将被重定向到example,这很好用.
So if someone types in www.example or www.example this gets redirected to example which works fine.
这是我目前在.htaccess文件中拥有的内容:
This is what I have currently have in my .htaccess file:
Options +FollowSymLinks RewriteEngine on RewriteCond %{SERVER_PORT} 80 RewriteCond %{SERVER_PORT} !^443$ [OR] RewriteCond %{HTTPS} on RewriteCond %{HTTP_HOST} ^www\.(.*) [NC] RewriteRule ^(.*)$ %1/$1 [R=301,NC,L]推荐答案
大多数SSL证书是针对特定主机名颁发的,例如www.example或example(*.example也可能有通配符证书),因此可能是这种情况.
Most SSL certificates are issued for a specific hostname, e.g. www.example or just example (and there can be wildcard certificates for *.example too) so this might be the case.
也许在最后一个RewriteCond中将 www.子域作为可选匹配可能有助于使用户进入证书中所述的域:
Maybe making the www. subdomain an optional match in the last RewriteCond might help to get the user to the domain stated in the certificate:
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*) [NC]
更多推荐
如何将https://www.example.com重定向到https://example.com
发布评论