How to solve the naked domain problem and forward to (non-www to www)

A problem every web developer has when starting with a new project is

Do I want to use or as the URL for my fancy new thing?

This is called the "canonical URL" and it's fairly important that you choose one option and stick to it. If you choose to use the www subdomain, all traffic to the non-www URL should forward to it and keep the path intact, e.g. should foward to

Which option to choose is up to you, there is no right or wrong answer, although many people argue that the www subdomain is not necessary nowadays since it comes from a time where ftp, gopher, telnet were other equally-important subdomains. Many short domains opt to use the non-www version, presumably to make their domain appear even shorter, and it also seems common for .io and .co domains.

If you choose to use the www subdomain, you need to find a way to forward all trafic from the non-www domain. Some domain registrars (like Namecheap [referral link]) or DNS management services (like DNSMadeEasy [referral link]) offer a forwarding option but many do not.

WWWizer - free naked domain redirect

A great service to solve this problem which I have been using for years is WWWizer. Their core offer is "SSL for the Cloud." but they let you forward your non-www domain for free.

The way it works is that you simply point your naked domain to a specific IP ( and all traffic will be forwarded to the www subdomain to that domain.

As an example this is the CloudFlare configuration for (ignore the grayed out stuff, the important part the image is discreetly marked.)

How to solve the naked domain problem and forward to (non-www to www)

  1. Set up your www prefix to serve your content (mine is a CNAME for a static website on Amazon S3)

  2. Set up an A Record for your naked (non-www) domain pointing to

  3. That's it! Your naked domain should now forward to your www-domain!

Discuss this post on Hacker News

Ideas? Constructive criticism? Think I'm stupid? Let me know in the comments!