Rewrite rule not working for WordPress subdirectory

I’m trying to rewrite WordPress URLs to another domain but the following rule isn’t working:

{
  "rewrites": [
    {
      "source": "/kurdish/wp(.*)",
      "destination": "https://example.com/kurdish/wp$1"
    }
  ]
}

but when i put "cleanUrls": true it works perfectly

Expected behavior:

Current behavior:

  • 404 Not Found

Vercel deployment details:

  • Framework: sveltekit
  • Node.js version: 20

There’s another community post with 404 debugging tips that might be helpful. Please give these solutions a try and let us know how it goes.

A human should be around soon to offer more advice. But you can also get helpful information quickly by asking v0.