php .htaccess创建子域,不包括查询字符串

I have following records in .htaccess

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(^.*)\.example\.com
RewriteRule ^([0-9].*)$  /folder/%1/$1 [L,NC,QSA]

What I want is: Show example.com/folder/user/0's content by accessing user.example.com/0 When I access user.example.com/0 my link looks like: user.example.com/folder/user/0 How can I fix it?

Here's something that would take any URL of the form user.example.com/N and make it into a redirect to example.com/folder/user/N

RewriteCond %{HTTP_HOST} ^(^.*)\.example\.com
RewriteRule ^([0-9]+)$  http://example.com/folder/%1/$1 [L,NC,QSA]

The redirect happens because of the change of host. This means the user's browser bar will become example.com/folder/user/N