· 7 min read ·
tutorials dns domain-forwarding https redirects naked-domain apex-domain

How to Redirect a Naked Domain to www (or www to Non-www) — The Definitive Fix

Ekke Uustalu
Ekke Uustalu · Founder
Redirect naked domain to www or www to non-www

TL;DR: You can’t CNAME a root domain — that’s a DNS protocol limitation. The fix: point your apex domain’s A record at Domain-Forward.com (free plan) and redirect naked→www or www→naked with HTTPS. Takes 5 minutes, no hosting required.


Someone types yourdomain.com into their browser. Nothing loads. They add www.yourdomain.com — your site appears. Or the reverse: your site works at the root domain but www shows a DNS error.

This is one of the most common problems in DNS, and it bites everyone from solo portfolio sites to enterprise businesses. The root cause: DNS doesn’t allow CNAME records on the apex domain, which breaks most modern hosting setups that rely on CNAME for routing.

If you’re here because half your visitors can’t reach your site, or because you want a clean redirect between yourdomain.com and www.yourdomain.com, you’re in the right place.

Why This Problem Exists: The CNAME Restriction

Here’s the technical issue. When your website is hosted on a platform like Netlify, Vercel, Shopify, Wix, or Squarespace, they tell you to add a CNAME record pointing your domain to their servers:

www  CNAME  your-site.netlify.app

This works perfectly for www.yourdomain.com. But for the root domain (yourdomain.com without www), you can’t use a CNAME record. Why?

The DNS specification (RFC 1034) says:

A CNAME record cannot coexist with any other record type at the same name.

Your apex domain always has SOA and NS records (they’re required for the zone to work). Therefore, a CNAME at the apex would violate the protocol. Most DNS providers will reject it outright.

This means:

  1. You can CNAME www to your hosting platform ✓
  2. You cannot CNAME the root domain to your hosting platform ✗
  3. Visitors who type the root domain get nothing — DNS error or wrong destination

Some DNS providers offer proprietary workarounds (ALIAS or ANAME records), but many registrars don’t support them. The universal fix is a redirect.

The Two Scenarios

Scenario A: Redirect naked domain → www

Your site lives at www.yourdomain.com (CNAME pointing to your host). You want yourdomain.com to redirect to it.

This is the most common scenario. Your hosting provider gives you a CNAME target, it works for www, and now you need the root to follow.

Scenario B: Redirect www → naked domain

Your site lives at yourdomain.com (using an A record or ALIAS). You want www.yourdomain.com to redirect to the root.

This is the “clean URL” preference. Many people prefer the shorter, non-www version. Search engines treat www and non-www as different URLs, so you need a 301 redirect from one to the other to consolidate SEO.

The Fix: Domain-Forward.com Handles Both Directions

Domain-Forward.com solves this cleanly:

  • Automatic SSL certificates — HTTPS works on whichever version you’re redirecting from
  • 301 permanent redirects — SEO value passes correctly to your canonical domain
  • Handles both directions — naked→www or www→naked
  • No hosting required — you don’t need a server just for a redirect
  • Free plan — up to 5 domains

Setting Up: Naked Domain → www

This setup redirects yourdomain.comwww.yourdomain.com

Step 1: Sign up at Domain-Forward.com (free, no credit card).

Step 2: Add a redirect:

  • Source: yourdomain.com (root only — not www)
  • Destination: https://www.yourdomain.com
  • Type: 301 (permanent)

Step 3: Update your DNS records at your registrar:

Record TypeHostValuePurpose
A@ (root)138.68.125.144Points root to Domain-Forward.com for the redirect
CNAMEwwwyour-host-target.comPoints www to your actual hosting provider

That’s it. The A record sends root domain traffic to Domain-Forward.com, which performs the 301 redirect to www. The CNAME sends www traffic directly to your hosting platform.

Setting Up: www → Naked Domain

This setup redirects www.yourdomain.comyourdomain.com

Step 1: Sign up at Domain-Forward.com.

Step 2: Add a redirect:

  • Source: www.yourdomain.com
  • Destination: https://yourdomain.com
  • Type: 301 (permanent)

Step 3: Update your DNS records:

Record TypeHostValuePurpose
A@ (root)Your hosting IP (e.g., your server’s IP)Points root to your actual website
CNAMEwwwedge.domain-forward.comPoints www to Domain-Forward.com for the redirect

Here, the root domain’s A record points to your actual server while the www CNAME goes through Domain-Forward.com and redirects to the root.

Wait for propagation

DNS propagation takes 1-4 hours. Once complete, SSL certificates are provisioned automatically for the redirecting domain.

Test it

Check both versions in your browser. Use our redirect tester tool to confirm the 301 is working correctly over HTTPS.

Why This Matters for SEO

Search engines treat yourdomain.com and www.yourdomain.com as two different URLs. If both resolve to the same content without a redirect, you have a duplicate content issue that splits your ranking signals.

A 301 redirect from one to the other tells search engines: “these are the same site — consolidate all ranking signals on the canonical version.”

Google’s official recommendation: pick one version (www or non-www) and 301 redirect the other. Learn more about redirect types in our URL forwarding basics guide.

Common DNS Setups Compared

Hosting PlatformWhat They Give YouRoot Domain Fix
NetlifyCNAME targetA record → Domain-Forward.com → redirect to www
VercelCNAME targetA record → Domain-Forward.com → redirect to www
ShopifyCNAME targetA record → Domain-Forward.com → redirect to www
WixCNAME targetA record → Domain-Forward.com → redirect to www
GitHub PagesCNAME or A recordsMay support apex — check their docs
Traditional hosting (cPanel)IP address (A record)CNAME www → Domain-Forward.com → redirect to root
SquarespaceCNAME targetA record → Domain-Forward.com → redirect to www

Stop Losing Half Your Visitors

If your root domain doesn’t redirect to www (or vice versa), anyone who types the wrong version gets nothing. That’s potentially half your direct traffic — the people who already know your brand well enough to type your URL.

The fix takes 5 minutes: create your free account, add the redirect in one direction, update one DNS record, and both versions of your domain work. Your email keeps working — MX records are never touched.

Frequently Asked Questions

What is a naked domain?
A naked domain (also called apex domain, bare domain, or root domain) is your domain without any subdomain prefix — e.g., example.com rather than www.example.com. DNS restrictions prevent CNAME records on the apex, making it harder to redirect.
Why can't I CNAME my root domain?
The DNS specification (RFC 1034) prohibits CNAME records at the zone apex because CNAME records cannot coexist with other record types like SOA, NS, or MX. Since the apex always has SOA and NS records, a CNAME there would violate the protocol.
How do I redirect my naked domain to www?
Point your domain's A record to 138.68.125.144 (Domain-Forward.com), set up a redirect from example.com to www.example.com, and the redirect handles the rest — including HTTPS with an automatic SSL certificate.
Should I use www or non-www as my primary domain?
Either works. Choose one canonical version and redirect the other. The www version is technically easier to manage with CDNs and external hosting (because subdomains support CNAME records), but non-www looks cleaner. Pick one and be consistent.
Does the naked domain redirect work with HTTPS?
Yes. Domain-Forward.com provisions an SSL certificate for your naked domain automatically, so visitors accessing https://example.com are securely redirected to https://www.example.com (or vice versa).
Will redirecting my naked domain break my email?
No. Domain forwarding only changes the A record for web traffic. Your MX records (which handle email) remain untouched.
How long does the redirect take to propagate?
DNS propagation typically takes 1-4 hours, though it can occasionally take up to 48 hours. During this time, some visitors may see the old behavior while others see the redirect.

Ready to simplify your redirects?

Start forwarding domains in minutes. Free plan available.

Get Started Free