.htaccess 301 redirect entire domain
I have been tasked with redirecting our entire domain with a 301 to make sure that "www" gets added to everything. However, whatever I try online (things I've come accross like blogs and articles on the topic) is not working - I keep getting a 500 error.
Could someone please help me with the steps of adding "www" to "mydomain.com" in every instance? Such as:
I'm so lost.
Thanks very much!