Add route to worker for cname'd url

Pages user here.

My Pages site has a custom domain. In the custom domain section, I have a worker.

The custom domain is It cnames to the Pages url, which is For preview (non-production) builds the actual URL looks like:

The worker is a work around for Pages mis-setting css mime types and so it determines whether the preview site will render correctly in browsers.

The route for the custom domain is: `

I think I would need a route like this for the preview builds: **

When I try to add this route for the worker, I get: Route pattern must include zone name: **

This must be because this url pattern doesn’t seem like it fits the zone It seems sort of weird that I’d need to create a domain for the Pages domain just so I can assign a route for the rule. That’s not really my domain–it’s CloudFlare’s.

Any ideas?


There was a similar post. The suggestion was to just add an ‘a’ record for a suitable domain and point it to a “null” url such as

So, I did that and the DNS for was happy with:

a to

Sort of weird as it’s not my domain to assign. But, ok.

Then I created a route to it thinking it would work because the a record is part of my zone.

Got essentially the same error. So, still stuck. Maybe close?