We use to use wildcard in the past but now we are using normal SSL certificate. Now the problem is we need to get
Your connection is not secure
Is there any way that I can get the url works slinky without geting that error by adding some script into apache or htaccess?
Short and longer answer is no there is not. The purpose of SSL is to make sure the connection is secure before connecting to the server resources. The SSL handshake happens before any server side script is ran or processed. That is by design and justifiably so. Otherwise someone could use some rogue self signed cert.
So it is impossible not to get the
You connection is not secure if you do not have a valid certificate.
Unfortunately the only thing you can do is keep using a wildcard cert if you want to make sure all your rewrites work for all subdomains. Nowadays they are pretty cheap and can easily be found for about $69/yr and maybe cheaper some places. I mostly use wildcard so that I can maximize my domains because they are so cheap compared to 5-10 yrs ago.
I've also answered this here.