skip to content
Tiny Game Dev

Custom Cloudflare domain and www redirect

How to redirect www to your custom Cloudflare domain.

Why doesn’t www work for my domain?

Cloudflare can serve as an excellent static site host, we use it for this blog. It’s also simple to register a custom domain and have it auto-setup, but unfortunately the www subdomain doesn’t automatically redirect as expected. By default will work, but won’t. Here’s how we fix it.

  1. In your Cloudflare dashboard, go to Websites > your website > DNS. Add a new CNAME entry with the name www and as target, and make sure you turn on the proxy.
  2. Go to Rules > Page Rules and set up a new redirect rule. Set the URL to*, pick the Forwarding URL setting, and the 301 status code. Set the destination URL to$1.

And we’re done, www should now redirect to you domain as expected.

Join our mailing list and hear about exclusive content like closed beta tests first. We don't mail often.