Redirect a Root Domain to www: Make example.com Work
If www.example.com opens your website but example.com doesn't, the root of your domain isn't pointing at it. Hosts that connect a domain with a CNAME record, Statpio among them, serve the www address, because a CNAME can't sit on the root. The fix is one setting where your domain's DNS is hosted: forward example.com to https://www.example.com with a permanent (301) redirect. Below are the steps for GoDaddy, Cloudflare, Namecheap, Hostinger, Porkbun and any other provider, the two traps that leave the root half working, and how to check the result.
Disclosure: this guide is published by Statpio, a host that serves websites on www and checks this forward for you. We link every outside fact to its official source.
Why doesn't example.com work when www does?
In DNS they are two separate names, and only one of them points at your website. To connect a domain to Statpio you create a CNAME record for www pointing to cname.onstatpio.com; even if you type example.com when you add the domain, Statpio connects www.example.com. The root (also called the apex or naked domain) can't take that record:
- A CNAME can't share its name. "A CNAME record is not allowed to coexist with any other data" (RFC 1912).
- The root always has other records. "Exactly one SOA RR should be present at the top of the zone" (RFC 1035), and the root often holds your email's MX and TXT records too.
Some DNS providers bend the first rule: Cloudflare's CNAME flattening "allows you to use a CNAME record at your zone apex". That doesn't help with Statpio, which serves only the www address you connected and never answers for example.com itself. So the root gets one job: send every visitor to www.
Which redirect should the root use?
A permanent (301) redirect to the full https address, https://www.example.com. A 301 says the address "has been assigned a new permanent URI" (RFC 9110), and Google's guide to redirects says Google uses a permanent redirect as a signal that the target should be canonical and shows the target in search results, while a temporary one (302 or 307) isn't used as that signal. Some forwarding services start on a temporary redirect, so check the type before you save.
How do you forward the root at your DNS provider?
Forwarding is set where your domain's DNS is hosted: the company your nameservers point to, which isn't always the one you bought the domain from. These are the steps Statpio's Custom Domains page shows for each provider; put your own domain in place of example.com.
GoDaddy
- Go to Domain Portfolio → select
example.com→ Forwarding. - Forward to:
https://www.example.com - Redirect type: Permanent (301)
Cloudflare
For a domain whose DNS is on Cloudflare, use a redirect rule:
- In DNS,
example.comneeds a record with the proxy on (orange cloud). If it has none, add an A record for@pointing to192.0.2.1, proxied. - Go to Rules → Redirect Rules → Create rule.
- When
Hostnameequalsexample.com, redirect tohttps://www.example.comwith status 301.
The proxy matters: Cloudflare's redirect guide says redirect rules need the hostname's traffic to be proxied by Cloudflare. 192.0.2.1 comes from a block of addresses reserved "for use in documentation" (RFC 5737); it only gives the root a proxied record so the rule can run.
Namecheap
- Go to Domain List → Manage next to
example.com→ Advanced DNS. - Add a URL Redirect Record: host
@, valuehttps://www.example.com, type Permanent (301). - Remove any other record for
@that points to a website (an A or CNAME record).
Namecheap's URL redirect guide adds that redirecting from one https:// address to another needs SSL certificates installed on both domains (as of November 2026), so test the https address afterwards, as shown below.
Hostinger
While the domain uses Hostinger's nameservers (Hostinger's guide):
- Go to Domains → Manage next to
example.com→ DNS / Nameservers → Redirects. - Redirect to
https://www.example.com, type Permanent (301), then Create redirect.
Porkbun
- Go to Domain Management → Details for
example.com→ the edit button next to URL Forwarding. - Leave Hostname empty and set Forward Traffic To to
https://www.example.com. - Under Toggle advanced settings, choose a permanent (301) redirect. Delete any default records for the root first.
Porkbun's URL forwarding guide says its free forwarding uses a temporary redirect (302/307) unless you choose the 301 in those advanced settings (as of November 2026).
Other
Any other DNS provider:
- Look for Forwarding, Redirects or URL redirect in its settings for
example.com. - Forward it to
https://www.example.comas a permanent (301) redirect. - If it has no forwarding, or its forwarding works only without https, move the domain's DNS to Cloudflare's free plan and use a redirect rule (the Cloudflare steps above).
Why does https://example.com still show an error?
Because the forward only works over http. If your provider's forwarding answers on http://example.com but not on https://example.com, anyone who types or clicks the https address reaches a server with no certificate for your domain, or no answer at all, and gets an error instead of your website. That is why the test below types the https address in full.
The fix is one of two: forward it with https, or move the domain's DNS to Cloudflare and use a redirect rule on a proxied root record (the Cloudflare steps above; Cloudflare's free plan includes 10 redirect rules, as of November 2026). If you move the DNS, copy every existing record across first: the two CNAME records for www that Statpio gave you, and your email's MX and TXT records.
Browsers are heading the same way. Google said in October 2025 that from Chrome 154, due in October 2026, Chrome would "ask for the user's permission before the first access to any public site without HTTPS" (HTTPS by default). A root that forwards only over http is one of those sites.
Why does example.com still show a parking page or the old site?
Because an older record still answers for the root: the registrar's default records, which may show a parking page, or the old host's A record. They and the forward can't both answer for the same name, which is why the Namecheap and Porkbun steps above say to remove them. Delete every record for @ that points to a website (A, AAAA or CNAME), keep the MX and TXT records your email needs, then save the forward again.
How does Statpio check that example.com forwards?
On Solo Pro and up, once a www domain is active, the Custom Domains page tests its root: it requests http://example.com and https://example.com, follows their redirects and sees whether they end on your website. The answer sits under the domain, after Without www:
| The Custom Domains page says | What it means |
|---|---|
| example.com forwards to https://www.example.com. | Done: the root reaches your website. |
| example.com forwards only without https: visitors who type https://example.com get an error. | The https trap above. |
| example.com still shows another website or a parking page. | An old record still answers for the root. |
| example.com points to a server that doesn't answer. | The root's address doesn't answer web requests. |
| example.com doesn't point anywhere yet. | The root has no address (A or AAAA) records. |
Source: the messages as Statpio's Custom Domains page writes them (November 2026). The last three also say "Forward it to https://www.example.com at your DNS provider."
The check runs when you open the Custom Domains page (at most every 10 minutes), every night with the domain status checks, and whenever you click Check again. When there is a problem, How to fix opens the forwarding steps above, in tabs for GoDaddy, Cloudflare, Namecheap, Hostinger, Porkbun and Other, with the provider Statpio detects from your domain's nameservers marked "yours". The domain's Setup panel shows them too, as step 2, "Make example.com (without www) open your website". The website's overview shows an amber line while the root doesn't open the site, and the AI connector's check_domain reports the same answer. Statpio checks the forward; it never serves example.com itself.
How can you test the forward yourself?
- Open a private window, so the browser can't reuse a redirect it remembered: a 301 "is heuristically cacheable" (RFC 9110).
- Type
example.comand press Enter. The address bar should end onhttps://www.example.com, showing your website. - Type
https://example.comin full. You should land in the same place with no warning; an error here is the https trap. - Type
http://example.comin full. Same again.
From a terminal, curl -I http://example.com and curl -I https://example.com print each answer's headers: look for a 301 status and a Location header with https://www.example.com. DNS changes can take a while to reach everyone, so if a new forward doesn't show yet, try again later or click Check again.
Custom domains, and the root check with them, come with Solo Pro and up: 5 domains across your account on Solo Pro, 10 on Studio Pro, 30 on Agency Pro (see pricing). The whole setup, from the two CNAME records to SSL, is in the guide to connecting your own domain, and the other domain features are on the features page. To start, create a free account and publish on a free onstatpio.com address; your own domain can follow when you choose a paid plan.
Frequently asked questions
What is the difference between a root domain and www?
The root (also called the apex or naked domain) is the domain itself, such as example.com; www.example.com is a subdomain of it. In DNS they are separate names with their own records, so one can open your website while the other doesn't. On Statpio the website is served on www, and the root forwards to it.
Can I use a CNAME record on my root domain?
Not a standard one: a CNAME can't share its name with any other record, and the root always holds some, such as its SOA record. Some DNS providers flatten a CNAME at the root, but that doesn't help with Statpio, which serves only the www address you connected. Forward the root to your www address with a permanent (301) redirect instead.
Should I use a 301 or a 302 redirect for the root domain?
A 301. Google uses a permanent redirect as a signal that the target should be the canonical address and shows the target in search results, while a temporary 302 or 307 isn't used that way. Some forwarding services default to a temporary redirect, so check the type when you save it.
Will forwarding the root domain affect my email?
Not if you keep the email records. Email uses the root's MX records (and TXT records for checks), not the web forward. When a step says to remove records for the root, remove only the ones that point to a website, the A, AAAA or CNAME records of an old site or a parking page, and leave MX and TXT in place.
How long does a root domain forward take to work?
It depends on your DNS provider: DNS changes can take a while to reach everyone. Test in a private window so your browser doesn't reuse an old answer, and on Statpio click Check again on the Custom Domains page; a fresh check runs at most every 30 seconds.
Does Statpio serve the root domain itself?
No. Statpio serves your website on www (or on a subdomain you connect) and never answers for example.com itself. You forward the root to www at your DNS provider, and on Solo Pro and up the Custom Domains page checks that the forward works, with and without https.
Keep reading
Related articles
Deploy a React or Vite App for Free, With a Domain and Form
How to deploy a hand-built React or Vite app for free: build it, upload the dist folder or deploy from the command line or GitHub, stop 404s on refresh, connect your own domain and add a contact form that needs no backend.
Read nextHow to Publish a Claude Artifact as a Real Website
Claude shares an artifact as a link to a page Anthropic hosts. To put it on a website of your own, export the HTML or let Claude publish it through the Statpio connector, then add a form that works and visitor statistics.
Read next
Deploy an Older Lovable, Bolt or v0 Site on Your Own Domain
Built with Bolt.new, v0, Cursor or Claude, or a Lovable project made before 13 May 2026? Find out what kind of app you have, build it, upload it and connect your own domain.
Read next
How to Host Client Landing Pages: Domain, Forms, Handover
A step-by-step workflow for agencies and freelancers: deploy a client's landing page, connect their domain, capture leads, add analytics and hand over through a branded client portal, with the plan each step needs.
Read next