Q:

Rewrite subdomain without breaking single page ssl

Is it possible to rewrite a subdomain with a domain having a single page ssl certificate? 
What i want to do:

Rewrite subdomain.domain.com to domain.com/index.php&page=subdomain

What i´ve got so far:
   RewriteCond %{HTTP_HOST} ^(.*)\.domain\.com [NC]
   RewriteCond %{REQUEST_FILENAME} ! -f
   RewriteCond %{REQUEST_FILENAME} ! -d
   RewriteRule ^(.*)$ /index.php?user=%1&req=$1 [L,QSA]

This gives me a bad SSL certificate as i dont have subdomain certificates. 
Using var_dump on $_SERVER in php returns the following:
["SCRIPT_URI"]=> string(24) "https://subdomain.domain.com/" 
["HTTPS"]=> string(2) "on"  
["SSL_TLS_SNI"]=> string(15) "subdomain.domain.com"  
["SSL_SERVER_S_DN_CN"]=> string(14) "www.domain.com"

So its still passing it as a subdomain instead of redirecting it. 
If i use the full domain as rewrite rule, it works but its also chaning the url in the title bar to domain.com/index.php?user=subdomain, instead of keeping the url:
RewriteRule ^(.*)$ https://domain.com/index.php?user=%1&req=$1 [L,QSA]

So how is it possible to rewrite the subdomain to domain.com/index.php?user=subdomain while keeping subdomain.domain.com and still be able to use the one page ssl certificate? 

A:

It is not possible to let a webserver serve webpage on a subdomain (e.g. subdomain.domain.com) but keeping an one page SSL certificate which is only valid on domain.com.  Technically it's possible, but doing so will make the browser warn the user of an invalid SSL certificate and place distrust into your website among the visitors.  There are now several options to solve this problem:

Get a wildcard SSL certificate
Get a Multiple Subject Alternative Names SSL certifate (older/mobile browser may warn the user of such a certificate)
Make a new apache virtual host configuration and let apache serve a different one page SSL certificate (which you need to get for subdomain.domain.com)

The best option here is 3, as you can get on several websites free one page SSL certifates and use them for your purpose (e.g. StartSSL, LetsEncrypt).  Setting up a new virtual host config isn't hard, as you can copypaste the most part of the existing virtual host config of your website (you just need to change a few things (e.g. SSL certificate, SSL key, SSL chain, site name...)).