I would like to add a custom domain to a Cloudflare Pages project by wrangler cli, however, according to the AI’s answer of Cloudflare itself, the command would be npx wrangler pages domain testing1234.minimal.site --project minimal-site-testing1234, but it doesn’t work, and I got the error message says ✘ [ERROR] Unknown arguments: project, domain, testing1234.minimal.site.
Gemini says Cloudflare Pages doesn’t support such approach, but Grok and ChatGPT give me similar approaches like the command above, none of them works.
Does anyone have any experience on this? Thanks in advance!
Trying to add a custom domain to a Pages project by npx wrangler pages domain testing1234.minimal.site --project minimal-site-testing1234 which according to the answer by Cloudflare AI itself, but get error message says ✘ [ERROR] Unknown arguments: project, domain, testing1234.minimal.site.
Does anyone have expression on this? Add a custom domain to a Pages project by wrangler cli but NOT the dashboard.
Thank you @Chaika! But, I added a custom domain by the Restful API, however, it keeps “Verifying” for over 2 hour already. And I tried to add two other custom domains on the dashboard, both turned to “Active” in 2 minutes.
You need to add the CNAME to your Pages Website. The UI normally does it for you, but since you’re using the API to add the domain, you don’t get all the nice UI magic.
It just needs to be a proxied CNAME. You can look at your other active custom domains as reference, the CNAME Target is your Pages Subdomain, which you can also grab via Get Project Cloudflare API | Pages › Projects › Get Projectsubdomain field.