How to enforce redirect from non-www to www via .htaccess file

On one of my sites I had this tiny little problem - I needed to enforce redirection from to because both websites were active and thus provided duplicate content which is very bad for Google ranking. Ok so how to do it? 1. In your web root (usually where index.html or index.php is) find file .htaccess (yeah it really starts with dot in the beginning which marks "hidden" in Unix structure) 2. edit it and add following: RewriteEngine On RewriteCond Read more [...]