A: 

Try with this:

RewriteCond %{REQUEST_URI} ^/yoursub

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ http://yoursub.domain.com/$1 [L]

The 2 lines in the middle will prevent redirecting if that folder or file exists. To remove file and folder exception, comment out that 2 lines, and stay with this only:

RewriteCond %{REQUEST_URI} ^/yoursub
RewriteRule ^(.*)$ http://yoursub.domain.com/$1 [L]
CuSS
Probably my question wasn't clear enough:I want to redirect different folders to different subdomains. The subdomains have the same name as the folders and i'd like to have only one rewrite for all of them.Example: /test -> test.domain.comExample2: /dog -> dog.domain.com
why don't you configure out the apache insted of rewrite?http://www.howtoforge.com/forums/showthread.php?t=23
CuSS