Thanks for the reply.
I truned on logging, I was able to figure it out ,, now its working.
Its working when there is no www prefix enetered in the address bar.
I need to get it work for even when www is entered along with the sub domain.
If I type in xyz.mydomain.com , it should forward to mydomain.com/folder/index.html?host=xyz
Also when i type in www.xyz.mydomain.com , it should forward to mydomain.com/folder/index.html?host=xyz
Could you please tell me the rewrite rule for this condition ?