Unverified Commit 05fb9df0 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Add note about priority to rewrites docs (#17535)

This adds a note about public files and pages taking higher priority over rewrites causing them to not be able to be rewritten unless the files are renamed first since this has been asked a few times. 

x-ref: https://github.com/vercel/next.js/discussions/17513
x-ref: https://github.com/vercel/next.js/discussions/9081#discussioncomment-22077
x-ref: https://github.com/vercel/next.js/discussions/9081#discussioncomment-21995
parent 2a047a8f
......@@ -17,6 +17,8 @@ Rewrites allow you to map an incoming request path to a different destination pa
Rewrites are only available on the Node.js environment and do not affect client-side routing.
Rewrites are not able to override public files or routes in the pages directory as these have higher priority than rewrites. For example, if you have `pages/index.js` you are not able to rewrite `/` to another location unless you rename the `pages/index.js` file.
To use rewrites you can use the `rewrites` key in `next.config.js`:
```js
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment