How to let non-www redirect to www domain?

Today I installed DEDECMS, a very popular PHP CMS open source system, I found I can not let non-www redirect to www domain. Say my domain is glassespeope.com, then I can not let http://glassespeople.com redirects to http://www.glassespeople.com. I tried to google, and found the following code can resovle the problems: RewriteEngine On RewriteCond %{HTTP_HOST} ^glassespeople.com […]