Repository: next.js
Issue: rewrite rules are causing a page refresh (on Vercel)
Labels: bug

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
      Platform: linux
      Arch: x64
      Version: #1 SMP Fri Apr 2 22:23:49 UTC 2021
    Binaries:
      Node: 18.15.0
      npm: 9.6.7
      Yarn: 1.22.11
      pnpm: N/A
    Relevant Packages:
      next: 13.4.9-canary.2
      eslint-config-next: 13.4.8
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.6
    Next.js Config:
      output: N/A
```


### Which area(s) of Next.js are affected? (leave empty if unsure)

_No response_

### Link to the code that reproduces this issue or a replay of the bug

git@github.com:codeurs/next-translations.git

### To Reproduce

I'm not able to replicate the bug locally.
The bug only appears when the app is deployed on Vercel: [https://next-translations.vercel.app](https://next-translations.vercel.app)

To run the app locally:
```
git clone git@github.com:codeurs/next-translations.git
cd next-translations
yarn
yarn build
yarn start
```

### Describe the Bug

1. Navigate to [https://next-translations.vercel.app/en](https://next-translations.vercel.app/en)
2. Open the inspector (F12) and open the network tab
3. Record the network log (Ctrl + E)
4. Click the apple link within the navigation bar
  It will navigate you to `/en/fruit/apple`
5. Within the network log you will notice that there are two 404 error responses.
  Their filenames are something similar to
    - `appel?_rsc=5huma`
    This actually is the NL version of the route: `/nl/fruit/appel` (followed by ?_rsc=5huma)
    - `pomme?_rsc=5huma`
    This actually is the FR version of the route: `/fr/fruit/pomme` (followed by ?_rsc=5huma)
 6. Click the FR language at the top right corner to change the language of the app to FR.
  It will navigate you to `/fr/fruit/pomme` and **it will trigger a full page refresh**
  Within the network log you will notice that there are five 404 error responses.
  Their filenames are something similar to
  - `pomme?_rsc=ghn7z`
    This is the current route, followed by ?_rsc=ghn7z
  - `banane?_rsc=ghn7z`
  - `raisin?_rsc=ghn7z`
  - `carotte?_rsc=ghn7z`
    These are all the other FR navigation links
  - `appel?_rsc=ghn7z`
    This is the NL translation of the current route

![rewrite-redraw](https://github.com/vercel/next.js/assets/1882256/dc677b3b-32c5-4f70-a008-3d0d39150756)

The app routes in the code are all written in English, the translations are rewrites to these English paths (`next.config.js`).
The default EN routes are all working and not resulting in 404 responses:
- [locale]/fruit/apple
- [locale]/fruit/banana
- [locale]/fruit/grape
- [locale]/vegetables/carrot

But all the rewrited routes are resulting in 404 responses that are causing a page redraw:

| source route | locale | destination route |
| ---                           | ---           | ---  |
| [locale]/fruit/appel | NL | [locale]/fruit/apple |
| [locale]/fruit/pomme | FR | [locale]/fruit/apple |
| [locale]/fruit/banaan | NL | [locale]/fruit/banana |
| [locale]/fruit/banane | FR | [locale]/fruit/banana |
| [locale]/fruit/druif | NL | [locale]/fruit/grape |
| [locale]/fruit/raisin | FR | [locale]/fruit/grape |
| [locale]/groenten/wortel | NL | [locale]/vegetables/carrot |
| [locale]/légumes/carotte | FR | [locale]/vegetables/carrot |

### Expected Behavior

I would expect that there is no full page refresh and that the rewritten routes are not resulting in 404 errors while fetching their data.

### Which browser are you using? (if relevant)

_No response_

### How are you deploying your application? (if relevant)

Vercel