This should be a very simple question to answer.
How would I setup a .htaccess file to send visitors from mydomain.com to http://www.mydomain.com?
I just had some Ajax headaches caused by the same-source rule, and this should be an easy way around it.
Don’t do that. Doing reverse makes sense. See http://no-www.org/
But to answer: