I attempting to rewrite subdomain. For instance test.mydomain.com to mydomain.com/test.php
I've produce a domain *.mydomain.com. Now I would like it to send data to mydomain.com/test.php when someone visits test.mydomain. com
It'll send "test" like a data.

I attempted this nevertheless its no longer working

RewriteEngine on    
RewriteCond %{HTTP_HOST} ^(.+)\.mydomain.com [NC]    
RewriteCond %{HTTP_HOST) !^www\.   
RewriteRule /test.php?$1 [L]    

Any solution? Wrong?

Try write this

RewriteRule (.+) /test.php?$1 [L]

Rather than this

RewriteRule /test.php?$1 [L]

You can also see some basic help