I am redirecting https://username.mywebsite.com/ to https://mywebsite.com/username using this redirection
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]
But I get this error when I try my page using subdoamin:
There is a problem with this website’s security certificate.
The security certificate presented by this website was issued for a different website's address.
Security certificate problems may indicate an attempt to trick you or intercept any data you send to the server.
We recommend that you close this webpage and do not continue to this website.
Recommended iconClick here to close this webpage.
Not recommended iconContinue to this website (not recommended).
I can click "Continue to this website (not recommended). " and my browser ignore the error but this is not user friendly.
I have unlimited users and my SSL is wildcard . I don't want users get this error :(
I have added *.mywebsite.com to the routing
Here is may ssl config
<VirtualHost *:443>
ServerName mywebsite.com
ServerAdmin webmaster@mywebsite.com
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>
Any help please.