How to redirect non www to www

 

There are still sites you cannot reach without using www in domain name. That is DNS configuration problem, but what if you find that your site is indexed with 2 domain names – one withwww.yourpage.com
and yourpage.com. For search engines, these are two different sites with the same content.

Non WWW to WWW redirection

#Options +FollowSymlinks
RewriteEngine On
RewriteCond %{http_host} ^yoursite.com
RewriteRule ^(.*) http://www.yoursite.com/$1 [R=301,L]

If you have any problem please remove “#” from the  first line.