Redirecting web site visitors from non-www to www pages
If you have loaded your web site in your browser and the URL is being displayed as example.co.uk rather than www.example.co.uk, you can add a bit of code to your htaccess file to redirect all users to the www. address.
To do this, add the following lines to your .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]