Redirecting Naked Domain to www

To redirect a naked domain (example.com) to a www subdomain (www.example.com) using Cloudflare, follow these steps:

  1. Log in to Cloudflare: Go to the Cloudflare dashboard and log in to your account.

  2. You MUST make sure that your domain is added to Cloudflare.

  3. The weirdest part: You need a DNS record for the naked domain. My recommendation is to route to the exact same location as your WWW (or whatever subdomain). This is because Cloudflare cannot process rules for a domain if it is not proxied.

  4. The root domain DNS setting MUST have proxying activated. Even if you don’t have proxying for your WWW, but you do need proxying active for your ROOT.

  5. Visit RULES inside your domain.

cloudflare naked redirect WWW

https://developers.cloudflare.com/rules/url-forwarding/single-redirects/create-dashboard/

  1. Make sure you notice there are 2 wildcards. The bottom line should use the {2} for the path since it represents the path of the URL. The first capture should be disregarded.