1.Find .htaccess file in root folder 2.Open .htaccess file 3.Delete all content 4.Type in this code(using your domain ): <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} !^www.example.co.uk$ [NC] RewriteRule ^(.*)$ http://www.example.co.uk/$1 [L,R=301] RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] </IfModule> Code (markup): 5.Save the file 6.Put file in root folder 7.Upload file on the server( make sure you put .htaccess file in the root folder 8.Check if the 301 redirect is successful use this page to check( personally myself using this one): http://www.stepforth.com/resources/server-header-checker-tool/#.Upp_YcRdX4b 9.Make sure you see the following code within #1“HTTP Status Code: HTTP/1.1 301 Moved Permanently” 10.That code will confirm the 301 redirect is being properly communicated. I've edited .htaccess file for my two websites http://www.eurodecorating.co.uk http://www.kjconversions.co.uk Works fine and you'll save your time! Any questions please ask.
Here is the most simplest rule to redirect non-www pages to www: RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] Code (markup):