Several times we have received above question from our customer in order that to day we will show you how to redirect your Magento site from a non-www, ex. http://yoursite.com to http://www.yoursite.com. There is a trick there.
- Enable Url rewriting (Admin Panel → System → Configuration → Web → Url Options → Use Web Server Rewrites → Yes).
- Now go to your .htaccess file on your Magento folder, (you might need to back up your .htaccess before making your changes.)