Cloudfare Pages & issues with custom domains

First of all, building and deploying my Gatsby website with Cloudflare Pages was truly amazing. Thank you for creating such an awesome product that makes our life so much easier & fun!

I ran into my first issue with custom domains. At first, I manually created the cname record myself, but that alone didn’t seem to work. I got an error page from Cloudflare that the host isn’t answering. So I went to the Custom Domains tab for the Page and set the same domain there, and Cloudflare asked me if I wanted to replace my cname record that I manually created with another one that was exactly the same, which I did. However, the same error was still coming up, but after one or two minutes it magically started working.

The second issue I’m still currently running into is support for wildcard domain, e.g. *.domain.com. The custom domains tab doesn’t allow me to type *.domain.com. I tried changing my wildcard record which is pointing to CloudFront today to my pages.dev Page, but that gives me a Cloudflare error page that the host isn’t anwering.

For clarification, am I required to setup the custom domain in the Custom Domains tab for the Page, or is it enough to set the cname record myself? If I am required to set my custom domain in the Custom Domains tab, can you add support for wildcard domains?

Thank you.

1 Like

I did an experiment where I removed the custom domain for my Cloudflare Page, and then added the cname record manually afterwards. It doesn’t seem to work, which is likely why my wildcard record isn’t working also. It looks like the custom domain has to be set under Custom Domains for the Cloudflare Page. That means wildcard domains won’t work until support has been added for wildcard domains on the custom domains page.

And this is the error that occurs if you add the cname record but don’t add the custom domain for the Page:

1 Like

Hey @JonArason, thanks for trying Pages :slight_smile:

You should definitely set up custom domains through the Pages UI. It isn’t quite as simple as setting up a CNAME record - we have to manage things on our end and set up some things so your custom DNS records resolve to your Pages application.

I don’t think we currently support wildcard domains, but I’ll check in with the team and confirm that. Thanks for trying it though!

2 Likes

Ah gotcha. It would be really cool if we could toggle a setting that would accept all request to my-page.pages.dev, no matter what custom domain has been set for the associated Cloudflare Page. That way I could configure my own wildcard record and point it to my-page.pages.dev.

(X) Accept all requests

My use case is that I have a single SPA website which is used for *.domain.com, where * can be any organisation name, e.g. organisation.domain.com. The SPA website checks what the subdomain is and fetches the organisation and displays it. This is currently not possible with Cloudflare Pages, but works great with CloudFront + S3.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.