Redirect .pages.dev using a worker

Since at the moment there is no way to redirect CP’s .pages.dev, is there a simpler way to edit this worker to make it work?

Redirects:
You can make pretty simple and basic redirects using the _redirects file. For anything more advanced, you can now use workers in CP projects (below)
https://developers.cloudflare.com/pages/platform/redirects
Workers:
It’s still in open beta, but you can now create function handlers, or entire Workers with your CP project.

The .pages.dev URL cannot be redirected with a _redirects file though.