It it always a good idea to decide if you want to make your website accessible through http://www.domain.com or http://domain.com, and stick with it. Having both of those versions working might split your backlink count and cause problems with search engine indexation (you can read more about it on the article WWW or no-WWW?).
The best way to solve this problem is to set a Enforce www. Preference“.
Once you upload and activate the plugin it will enforce the address that you have on the WordPress control panel (under the General tab on Options). If on the control panel you have http://www.domain.com, for instance, the plugin will add a www. every time a visitor tries to access the site through http://domain.com. Another advantage of this plugin is that it removes the index.php from the end of URIs.