Rewrite traffic based on hostname

I'm building a site with custom domains. I would like to have my base domain (base-example.com) render normally, but
IF hostname !== base-example.com
I want to render the content of
base-example.com/api/custom-content?host=some-hostname.com
  • How can I do that?
use workers, but could switch to pages if needed.
Was this page helpful?