it seems nowadays its better to redirect www.mydomain.com to mydomain.com ? google like which one due to the latest SEO updates
You should not redirect to without WWW. WWW.domain.com format is very much important and secure issue. WWW. before the domain works as a sub-domain that helps you to keep your main domain secure. When, WWW gets blocked, you can change it again to WW2 or other things. However, you will need to change the entire website if your main domain gets blocked by GOOGLE!