子域redirect在apache中导致错误

我使用此redirect将https://username.mywebsite.com/redirect到https://mywebsite.com/username

RewriteEngine On RewriteCond %{HTTP_HOST} ^(.*).mywebsite.com [NC] RewriteRule .* https://mywebsite.com/%1 OR RewriteCond %{HTTP_HOST} ^([^.]+)\.mywebsite\.com RewriteRule ^(.*)$ https://mywebsite.com/%1 [L,NC,QSA,R] 

但是,当我使用subdoamin尝试我的页面时,出现此错误:

这个网站的安全证书有问题。

本网站提供的安全证书是针对不同网站的地址发布的。

安全证书问题可能表示试图欺骗您或拦截您发送给服务器的任何数据。

我们build议您closures此网页,不要继续访问本网站。

推荐的图标点击这里closures此网页。

不build议icon继续到这个网站(不推荐)。

我可以点击“继续浏览本网站(不推荐)”,我的浏览器忽略错误,但这不是用户友好的。

我有无限的用户,我的SSL是通配符。 我不希望用户得到这个错误:(

我已经将* .mywebsite.com添加到路由

这里是可能的SSLconfiguration

 <VirtualHost *:443> ServerName mywebsite.com ServerAdmin [email protected] DocumentRoot /var/www/html/mywebsite.com RewriteEngine on SSLEngine on #SSLProxyEngine on SSLCertificateFile /etc/apache2/ssl/markethive.com/mywebsite.crt SSLCertificateKeyFile /etc/apache2/ssl/markethive.com/mywebsite.key SSLCACertificateFile /etc/apache2/ssl/markethive.com/mywebsite.ca-bundle LogLevel info ErrorLog /var/log/apache2/markethive.com_ssl/error.log CustomLog /var/log/apache2/markethive.com_ssl/ssl.log combined </VirtualHost> 

请任何帮助。

这意味着你的SSL证书不是一个真正的证书(可能是你自签名的?)。

  • 要获得SSL证书,您必须find一个SSL提供商,并从中获得您的证书和密钥。 这将花费你的钱购买SSL证书。

  • 您也需要每个子域的证书。

  • 如果您拥有官方证书,请尝试更正客户端计算机上的时间。

  • 检查你的SSLconfiguration,这可能是不正确的

  • 如果您使用通配符SSL,则需要将您的证书设置为默认值,以便能够为每个SSL站点进行设置:


 <VirtualHost _default_:443> .. SSLCertificateFile /etc/apache2/ssl/markethive.com/mywebsite_com.crt SSLCertificateKeyFile /etc/apache2/ssl/markethive.com/mywebsite_com.key SSLCACertificateFile /etc/apache2/ssl/markethive.com/mywebsite_com.ca-bundle ... </VirtualHost> <VirtualHost *:443> ... #your server conf ... </VirtualHost>