by #redirect to subdomain I can't figure out how to solve the condition and rule like the other I have made.. somehow I need to extract the domain from the first condition and then use it in the rule with %1, but how can you do that when you got another condition in between?

@clarkk That's the context sensitivity of RewriteRule at work - My config assumed they were just in a VirtualHost block, where absolute paths are used, but when they're in a Directory block or .htaccess file, the relative path is used.
–
Shane Madden♦May 26 '11 at 0:34