Your own domain
Your site starts on a free address ending in workers.dev. To use your own domain, like
www.yourdirectory.com, allow about 30 minutes, most of it waiting. Your domain needs to be on
Cloudflare first (Cloudflare’s help on adding a
domain).
1. Choose your main address
Section titled “1. Choose your main address”People type a domain two ways: with www. and without. Choose one as your site’s main address, like
www.yourdirectory.com. The other one sends visitors to it (step 3). The address without www.
(like yourdirectory.com) is the simpler choice: Cloudflare has a ready-made rule for sending
www. to it.
2. Connect both to your site
Section titled “2. Connect both to your site”In Cloudflare, connect both addresses (with and without www.) to your site’s Worker as custom
domains (Cloudflare’s help on custom
domains).
Check: both open your site within a minute or two.
3. Send the other one to your main address
Section titled “3. Send the other one to your main address”In Cloudflare, add a redirect rule for your domain that sends the other address to your main one,
keeping the rest of the address. Cloudflare’s help has the rule for each way: from www. to the
address without
it, or
from the address without www. to
www..
If Cloudflare warns that the rule may not apply to your traffic, click Deploy anyway: your site’s custom domains from step 2 cover it.
Check: the other address, like yourdirectory.com/listings/, opens the same page at your main
address.
4. Tell your site its new address
Section titled “4. Tell your site its new address”In the editor: Settings → Your site → Address: your main address, starting with https://, like
https://www.yourdirectory.com. Click Save. In about 3 minutes, your site uses it for the links it
shares and for search engines.
5. Your spam check
Section titled “5. Your spam check”Only if you use automatic submissions or sponsorship payments: your spam check works only on the addresses it lists, so add yours, or your forms won’t accept what visitors send there. Until you do, your submit form says “We couldn’t check that you’re not a robot…” on your domain.
Add both addresses, without https:// (like www.yourdirectory.com and yourdirectory.com), to
the hostnames of your spam check’s widget (Cloudflare calls it Turnstile) (Cloudflare’s help on hostname
management).
Check: a few minutes later (about 5), the submit form on your domain no longer says “We couldn’t check that you’re not a robot”.
6. Signing in to your editor
Section titled “6. Signing in to your editor”Only if you sign in with GitHub. GitHub sends the sign-in back only to the addresses it knows, so add yours:
- On GitHub, edit your editor’s GitHub App: it’s named after your site, then “editor” and four letters or numbers (GitHub’s help on changing a GitHub App). GitHub may ask for your password first.
- Add
https://www.yourdirectory.com/api/cms/callback(your main address, then/api/cms/callback) as a Redirect URI. Keep yourworkers.devone, and leave Allow wildcard matching off. - Click Save changes.
Check: Sign In with GitHub at https://www.yourdirectory.com/admin/ opens your editor.
Until you’ve done this, sign in at your workers.dev address: it keeps working. On your domain,
GitHub says Be careful! The redirect_uri is not associated with this application: that means
your address isn’t added yet.
7. Search engines
Section titled “7. Search engines”Tell Google and Bing about your new address: Search engines.
Cloudflare Web Analytics
Section titled “Cloudflare Web Analytics”Only if you count visits with Cloudflare Web Analytics: once your domain is on Cloudflare, Cloudflare can add Web Analytics to your pages by itself, so visits would be counted twice. If your editor says Cloudflare Web Analytics is added twice, open Settings → Analytics, empty ID from your analytics service (keep Cloudflare Web Analytics chosen), and save. Your numbers start again under your domain, as a site of its own in Web Analytics.
Check it
Section titled “Check it”If you use the Terminal: npm run doctor -- --live checks your address, and whether the other form of
it reaches your site and sends visitors on. It also lists steps 5 and 6 for you to check, since they
can’t be seen from outside.
Your workers.dev address keeps working too. Search engines are told your main address is the one
(each page names it), so they don’t list both.