I'm about to write this code (using tomcat so I don't think there's an easy .htaccess solution), but figured I would see if there's already a service that does this for me. I need mydomain.com/* to be redirected to www.mydomain.com/*. So the easiest thing to do, if it exists, is to point the dns record for mydomain.com to a service which just does a 301 redirect to www.mydomain.com with the same path and parameters.
Any such service exist?