how to manage url redirects in drupal 7 My website is currently accessible via 2 address

www.mydomain.com
and 
mydomain.com

What is the best way to manage redirects. I would like

mydomain/blah to redirect to www.mydomain.com/blah
I always use the vhost file for this:

# Enforce domain.
RewriteCond %{HTTP_HOST} !^example.com(:.*)?$
RewriteCond %{HTTP_HOST} ^(?:.*?)(:.*)?$

RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]


I would much rather to this on the Apache level, than PHP, to keep it as fast a possible.

Similar configuration for nginx here.