i use this config in apache2 for wildcard subdomain and works good :
<VirtualHost *:80>
DocumentRoot /var/www/
ServerName sumdomains.example.com
ServerAlias *.example.com
RewriteEngine On
RewriteRule ^/(.*) /%{HTTP_HOST}/$1
</VirtualHost>
this means, a request to http://user.example.com/foo.html will fetch the file /var/www/user.example.com/foo.html.
but i want request to http://user.example.com/foo.html fetch file from /var/www/user/foo.html.
which wildcard should am i use for this?