I’ve seen many sites keep two different sites, their non-www form and their www. form. Primary example can be http://mindpetals.com/. Unlike most sites, Mind Petals seems to be indicating its links to the non-www form. They should therefore have all of their links, not just their homepage, but all subpages and subdirectory pages automatically only go to the non-www form. For an example, of this, try going to http://saadh.com/ , you can’t because it automatically redirects to the www version.
The best way to perform this is 301 redirect with a .htaccess file in your root folder. This is an Apache module, but almost every host supports it. To check to see if you are supported, you can ask your host, or just try out the mod_rewrite.
To forward domain.com to www.domain.com, use the following code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite\.com [nc]
RewriteRule (.*) http://www.mysite.com/ [R=301,L]
To forward www.domain.com to domain.com, use the following code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.mysite\.com [nc]
RewriteRule (.*) http://mysite.com/ [R=301,L]
Where do you place the code? Go to notepad, or any text file editor. Paste the code inside and save as “.htacess”, make sure not to have any extension like .txt. Then with ftp or a similiar method, upload the document onto your root folder if you want to redirect your entire site, or any subfolder if you’d only like to redirect a portion of your site.