Skip to content

Commit

Permalink
Add note about priority to rewrites docs (#17535)
Browse files Browse the repository at this point in the history
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: #17513
x-ref: #9081 (comment)
x-ref: #9081 (comment)
  • Loading branch information
ijjk committed Oct 2, 2020
1 parent 2a047a8 commit 05fb9df
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/api-reference/next.config.js/rewrites.md
Expand Up @@ -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
Expand Down

0 comments on commit 05fb9df

Please sign in to comment.