301 Redirect non www to www with htaccess file
Posted by admin on Jul.13, 2011, under Basics, SEO
Add this line of code to your .htaccess file.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
If you do not have a .htaccess file save a normal notepad file names .htaccess and upload it to your root directory.
*** This will only work on a Linux server. If you are running a windows based server you must make changes to your web.config file.***
Why should I redirect the non www version of my domain to the www version of it?
Well you might think this is crazy but the www and the non www version of your website are treated as two different websites. Search engines treat the www version as a subdomain because the truth is that it is a subdomain. Doing this wit the .htaccess file will do a true 301 redirect which will give you many benefits listed below!
This effects your website it three different ways.
Links to your website – Other websites might link to your website as www.domain.com or domain.com. Since they are treated as two different entities. The credibility link juice is spread out between both the www and the non www version. So you are losing potential value.
Duplicate Content – Even though most SEO experts will say this is the biggest factor I believe that it really is not. Search engines will pick one the www and the non www version and make one of the pages authoritative. You can easily test this and see that search engines only have one version of your website out there. Best practice is to make it one and I will explain it in the next reason!
How many pages your website is – This is a big player in my book. What kind of website might be more credible? A website that is 5 pages big or a website that is 40 pages bigger.
Search engines might have half of your www pages indexed and the other half of the pages without the www part before it. This decreases how big your website really is. The truth is smaller relevant websites do NOT rank as well as big relevant websites.
The truth is there are many factors when it comes to SEO but this is a big part. If you have a company that does not do this for you find someone else!














November 6th, 2011 on 7:41 pm
Yeah, I agree with you. I’m using ALT text for every image on my site.
Rajesh Namase recently posted..Useful Tips on iPhone 4S Siri, the Magical App That was Never Seen Before