Home > English, Internet > “www” on subdomains

“www” on subdomains

Many websites offer subdomains, but most of them fail when they are accessed with a “www”, such as http://www.subdomain.domain.com. The reality is that many users always write the three ‘w’s every time they write a web address. For this reason, I will explain how easy it is to configure your website to work with the “www” before a subdomain.

The trick is in the CNAME configuration. Just as you assigned a CNAME to your subdomain.domain.com, you now assign the “www.subdomain.domain.com” as a CNAME to “subdomain.domain.com”

An example entry of your Custom DNS Setting should look like this:

CNAME Record     subdomain                IN CNAME somesite.site.com

That will map your http://subdomain.domain.com to the site.com location. When users type in the “www” they will be sent to a “Page not Found” error page. To fix this, you add the other CNAME Record so that now it looks like this:

CNAME Record     subdomain                IN CNAME somesite.site.com

CNAME Record     http://www.subdomain      IN CNAME subdomain.domain.com

This last entry will fix your “www” problem for that subdomain.

Categories: English, Internet
  1. September 19, 2007 at 2:53 pm

    Will this work if you have mutiple subdomains?

    Thank you!

  2. September 19, 2007 at 6:31 pm

    Yes, this works for multiple subdomains. Just repeat these steps for all subdomains.

  3. January 18, 2009 at 2:44 am

    Hi Rafael,
    Although your post is already more than one year old, it helped me. Thanks for the post

  4. March 24, 2009 at 5:10 pm

    Super helpful! Thanks!

  5. Leo
    May 7, 2009 at 3:39 pm

    great advice! thanks!

  6. nomad
    September 22, 2010 at 1:05 am

    nobody types www anymore, not necessary. Browsers automatically take you to the site when you type domain.com. I was thinking also what if the main domain is setup in google to prefer www. but the subdomain doesn’t have the www will this effect seo for subdomain ?

  7. October 8, 2010 at 11:13 am

    Hi nomad,

    If the domain is not properly configured, a user could be taken to an error page when they type the “www” or when they don’t type it.

    In terms of SEO, as long as your configuration is taking you to one form of the domain, then there would be zero chance of having a negative impact in your SEO, since there would not be any duplicate content issues.

  8. October 10, 2011 at 11:50 am

    Isn’t this better handled at the web server level? i.e. with Virtual Hosts?

    • October 16, 2011 at 4:52 pm

      I think it is best handled at the domain level configuration with your registrar. However, if that is not an option, then I would configure it at the web server level.

  1. No trackbacks yet.

Leave a Reply to Jaap van de Putte Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: