Workers site default page different from index.html

I used wrangler to configure and publish my static website.
All good.

In my previous server I could configure “portada.html” as index page.

By default workers site uses 'index.html".

Is there a way to change this behavior inside wrangler.toml or elsewhere?

You can’t configure the index url, but could create a rule on the dashboard for a redirect.
Have you tried using Cloudflare Pages?

Maybe even a Transform rule which will save you a redirect.

Putting a redirect on the home page doesn’t look like a good practice to me.

I’ll check about the transform Rule.

Why Cloudflare Pages should be able to configure the index page while Workers site cannot.
Could it be implemented maybe?
site = {bucket = “…/www”,entry-point = “workers-site”, index=“portada.html”}

I’ve found a solution.

inside my index.js, workers-site directory, once the worker realises that index.html is not inside KV (catch event), I’m using this :

//see if url matches the domain name
if(url =="") {
  let homePageResponse = await getAssetFromKV(event, {
    mapRequestToAsset: req => new Request(`${new URL(req.url).origin}/myhomepage.html`, req),
  return new Response(homePageResponse.body, { ...homePageResponse, status: 200 })
//otherwise return the 404.html
let notFoundResponse = await getAssetFromKV(event, {
mapRequestToAsset: req => new Request(`${new URL(req.url).origin}/404.html`, req),
return new Response(notFoundResponse.body, { ...notFoundResponse, status: 404 })