"Rewrite" domain root to path of another domain without Worker?

I want to “bind” a custom domain to a specific path of another domain. Is this possible without using a Worker?

For example, I want https://customdomain.com to serve the content at https://mysaas.com/tenants/tenant-one. I do not want to simply forward or redirect to that URL. I’ve read through CF’s SaaS and Tenant services docs, but it’s still unclear if this can be achieved without using a Worker - i.e. by using some special variant of routing or rewrites available through those services.

I know this can be achieved with Worker logic, but I’d prefer to use a config-related approach instead of programmatic if possible. Does anyone have any info or insights?

You cannot rewrite the hostname using a rewrite URL rule.

You can instead use an Origin Rule or a Page Rule… AND an Enterprise plan (lower plans cannot rewrite the hostname even with these products that support hostname overrides).

A simple worker or Snippet (if you’re on a paid plan) does the job neatly.

Of course, you also have the Cloudflare for SaaS you mentioned – but you may have to confirm this with a rewrite rule. If you need help with this, you’ll have to let us know the exact steps you’ve taken, provide relevant Cloudflare screenshots, and provide the exact domains in question before we can provide any assistance.

1 Like

Thanks, @GeorgeAppiah, I appreciate you taking the time to respond.