How to do I create masked subdomains in CloudFlare

For my website I have multiple subdomains, for example demo.website.com, would redirect to website.com/demo/$1. That works fine with rules.
But for the user in the browser I want all pages to be masked as demo.website.com. I read that I should write workers for this? Does someone have a good example code to get me started? I’m looking, maybe I overlook while searching, as I’m not familiar with workers yet.

Sounds to me like you could try out Transform Rules → URL Rewrite, so the URL in a web browser for the visitor/user stays the same demo.website.com, while in the background it loads something else? :thinking: