Are www or no www same?

Many people thinks that www and without www are same but its not true both are treated as separate websites (or www can be treated as sub domain) both www and no www can be pointed to different IP addresses. Usually making an A entry with same records in DNS settings points www same as without www.


What should we choose www or no www?

Search engine treats www and no www as different domains therefore page rank and page indexing of both domains can be different from each other therefore by search engine point of view website owner should consider having only single domain instead of two versions.

URL Redirection with WWW

[sourcecode language=”plain”]</pre>

RewriteEngine On
rewriteCond %{HTTP_HOST} ^ [NC]
rewriteRule ^(.*)$$1 [R=301,L]
URL Redirection without WWW

[sourcecode language=”plain”]</pre>

RewriteEngine on
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
RewriteRule ^/(.*) http://%1/$1 [L,R=301]

Why choose WWW

Many professional organizations prefers www in their URL and URL with www preferred in stationary and other stuff.
Many people types www with website in anyway.

Why not to choose WWW

It makes URL longer.
Its unnecessary to use www when website can be viewed without using www.
More search engine friendly.

So its upto your choice what you want to choose however its suggested to use website without www and redirect www to without www url.

Cname Records

The best way to handle a www and non www. urls is to add a cName record and point it to your relevant domain for example if you are using as your main domain you can point cName records for without www. to and you can do same for non www. website.