Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrites behavior #13353

Closed
Timer opened this issue May 25, 2020 · 4 comments
Closed

Rewrites behavior #13353

Timer opened this issue May 25, 2020 · 4 comments
Milestone

Comments

@Timer
Copy link
Member

Timer commented May 25, 2020

I am using the following next config to rewrite dynamic urls to the next page pages/post/[id], which works great on my local machine (using next@9.4.2)

// next.config.js
module.exports = {
  experimental: {
    async rewrites() {
      return [
        {
          source: '/(.*)-:id(\\d+).html',
          destination: `/post/:id`,
        }
      ]
    }
  }
}

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?

Originally posted by @joafeldmann in #13347

@Timer Timer added this to the 9.4.3 milestone May 25, 2020
@balazsorban44
Copy link
Member

@Timer can you say something about the state of the corresponding RFC? Are there any serious work going on here? What about the experimental state? Is it near to stable or you are still trying out things under the hood, still a chance it will be dropped entirely? I am most curious of handling i18n with translated urls(not prepending with a language code, but actually translating parts of the url).

Just curious. Please mark as off topic if needed.

@Timer
Copy link
Member Author

Timer commented May 27, 2020

Closing as fixed in vercel/vercel#4484

@Timer Timer closed this as completed May 27, 2020
@Timer
Copy link
Member Author

Timer commented May 27, 2020

@balazsorban44 the intent is to get this to stable ASAP. There's no ETA, but we're actively working on it.

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants