IIS Rewrite rule to remove www from a subdomain

So let me guess,  you’ve purchased a wildcard SSL certificate and you’re looking to use it on a sub domain. You’ve probably landed here because you’ve discovered things aren’t as straight forward as they seem. Your wildcard ssl will work fine on your main website *.YourDomainName.com with both www. and no www. however things start…