Redirect non-www to www URLs using .htaccess

If you want to force your entire website to www from non-www, you can add these rules to your .htaccess file:
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Have something to Add?

Loading Facebook Comments ...
Loading Disqus Comments ...