By using this site you agree to the use of cookies.

Learn more

Share via:

www and non-www recommendations

Should we use www in front of our domains, or is non-www better? This article can hopefully help you decide.

Created: 2017-08-03 14:03

The www part of URLs is really just a subdomain, it is short for World Wide Web, and an optional server configuration. Many websites are not using it, as it often considered unnecessary.

Those who do not use the www subdomain typically redirect it to the clean version of their website. One reason is that some users still type "www" when they go to a website, and it would confuse those users if suddenly they got a 404 not found response.

The www subdomain has been used in combination with other subdomains, such as the pop or imap subdomains for mail servers, and ftp subdomain for FTP servers. Administrators would point each of these subdomains to each their own service. It is not really relevant for users, but some companies picked it up in their marketing of their website.


It is recommended that web developers simply redirect their users to one or the other. The preferred is to use the non-www version, because having www in the URL is irrelevant to users, and only requires more typing.

Redirecting your www subdomain

Redirecting the www subdomain can be done in a number of ways, one way is to use htaccess files, another is to configure the CMS system to do it, but not all CMS systems comes with this capability. You can try searching for a plugin that adds it, however.

When using htaccess files to perform the redirect, all you need to redirect incoming traffic on your www subdomain, is to create a file called .htaccess in a text editor, and place it in your server root. Then include the following content in the file:

RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^example\.com
RewriteRule (.*)$1 [R=301,L]

Note. You should replace, with your own domain name.