I have this code for rewrite anypage.php to anypage.html :
That mod_rewrite rewrites /anypage.html to /searchResult.php?q=anypage. If you really are getting /anypage.html to anypage.php it's probably MultiViews (mod_negotiation).
So so you want people who go to domain.com/folder/xx.html redirected to xx.domain.com/folder/xx.html (where there's a real (.php?) file).
Or do you want xx.domain.com/folder/xx.html rewritten to domain.com/folder/xx.html. If you want it rewritten, do you have DNS for the sub domains? What directory on the server are you sent to when you go to a sub domain at the moment?