Always add the www

less than 1 minute read

When creating a new website you want to create as little duplicate content as possible. Most host let your users access your website from either the or the www version This can be dramaticly reduce your site’s Page rank because is that most search engines see the ‘www’ and the ‘non www’ version as two different websites and Googles’s Page rank is split between the two sites. Instead of getting a solid PR4 you get two measly PR2 sites.

There is a solution You can force your users browser to redirect to the www version with a Mod Rewrite script.


  1. Create a new file called .htaccess
  2. Copy and past the snippet below in to the file.
    RewriteEngine on RewriteBase / # Always add the www RewriteCond %{HTTP_HOST} !^$ RewriteRule ^.*${REQUEST_URI} [R=301,L]
  3. Replace '' with your domain (replace in two locations)
  4. Upload the file to your base directory on your web server.

The next time your users try to browse to your non ‘www’ version of your website they will be automatically forwarded to you www version.

Leave a comment