21

Other than for historical reasons, is there is reason to have ?www? in a URL.
Should I do a permanent redirect from www.xyz.com to xyz.com or xyz.com to www.xyz.com? Which one would you suggest and why?

1

www is a subdomain usually used for the web server on a domain along with others for other purposes such as mail etc. Nowadays, the subdomain paradigm is unnecessary; if you connect to a website in a browser, you'll get the website, or sending mail to the server will use its mail service.

Using www or not is a matter of personal preference. Opposing points of view can be found at http://no-www.org/ and http://www.yes-www.org/ - however, I believe that www is unnecessary and just adds more cruft to the URI.

Most servers send the same site either way, but don't redirect. For SEO purposes, choose one, then get the other to redirect to it. For example, some PHP code to do this:

if (preg_match('/www/', $_SERVER['SERVER_NAME'])) {
  header("Location: http://azabani.com{$_SERVER['REQUEST_URI']}");
  exit;
}

However, some reasons promoting the use of a www subdomain made by other answerers are great too, such as not sending cookies to static servers (credit Konrad Rudolph).