I currently have a wild card subdomain with this on apache:
<VirtualHost xxx.xxx.xxx.xxx:80>
DocumentRoot /home/web/domaine.tld/www
ServerName domaine.tld
ServerAlias *.domaine.tld
VirtualDocumentRoot /home/web/domaine.tld/%1
CustomLog /var/log/apache2/domaine.tld/access.log combined
ErrorLog /var/log/apache2/domaine.tld/error.log
</VirtualHost>
And need to have any subdomain like sub.domain.tld being redirected to domain.tld