Repository navigation
How to use (experimental) custom routes / rewrites (#9081) on vercel? #13347
|
I am using the following next config to rewrite dynamic urls to the next page However, when I deploy the app to vercel I get an 404 for these routes. I am further confused with vercel routes (https://vercel.com/docs/configuration#project/routes) and rewrites (https://vercel.com/docs/configuration#project/rewrites). Which solution should be used when hosting next.js on vercel? |
Replies: 2 comments 7 replies
|
Hi, the new rewrites/redirects/headers in Working deployment with above rewrite in |
|
@joafeldmann could you please provide me with source-code of your example. I am trying to setup the same rewrite but getting |
Hi, the new rewrites/redirects/headers in
next.config.jsare automatically used when deploying on Vercel and the above rewrite looks like it is correctly working also. Can you provide a deployment or repo with a reproduction where this isn't working?Working deployment with above rewrite in
next.config.js: https://tst-rewrite-id980i1gh.now.sh/post-2.html