Is there something similar to _redirects file for Workers Site?


I’m new to Cloudflare. I used this guide to deploy my static assets to Workers Sites.

But I’m curious does the Workers Sites have something similar to pages _redirects file.

This topic tells no. More than 3 years passed by. So may be something like that appeared?

Thank you.

Or may be I can change the code that serves static files to redirect some urls?
(The code given here

The code that serves static files is as follows

import { getAssetFromKV } from '@cloudflare/kv-asset-handler';
import manifestJSON from '__STATIC_CONTENT_MANIFEST';
const assetManifest = JSON.parse(manifestJSON);

export default {
  async fetch(request, env, ctx) {
    try {
      // Add logic to decide whether to serve an asset or run your original Worker code
      return await getAssetFromKV(
          waitUntil: ctx.waitUntil.bind(ctx),
          ASSET_MANIFEST: assetManifest,
    } catch (e) {
      let pathname = new URL(request.url).pathname;
      return new Response(`"${pathname}" not found`, {
        status: 404,
        statusText: 'not found',

If someone is interested in the same feature I’ve made a repo


I’m just curious. Why did you use Workers Sites and not Pages, only to then recreate some Pages functionality?

There is a very clear warning at the top of the documentation you linked:

Is there any functionality in Worker Sites that is missing in Pages?

Hi, thank you for the response.

Yeah, I’ve seen this warning. But with Pages I’m bound to setup domain by hands via CNAME dns records. And with Workders Sites I’m able to accomplish everything I need by wrangler cli and scripts only.