g1smd - 3:29 pm on Dec 29, 2011 (gmt 0)
One or two lines of RewriteRule code will do the job.
It's almost the same code you use to redirect non-www to www. Just test for NOT www.example.com to redirect all non-canonical variants.
Use example.com in this forum to suppress the auto-linking function.