To force all website visitors to use either user the www. part of the domain or not in the URL (useful for search engines) create a file called ".htaccess" then place within it (using a text editor such as notepad) one of the following two code examples below.
Be sure to replace "domain.com" with the site's domain name the .htaccess code is being uploaded too.
To force your site to use "www." in the URL:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^domain\.com$
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
To force your site to NOT use "www." in the URL:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.domain\.com$
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
Simply then save your changes to the ".htaccess" file and upload it within the "public_html" folder of your account.
After doing this, anyone who enters http://domain.com into the browser will be redirected to http://www.domain.com.