Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Please add support for redirect and rewrite rules of Next Js #564

Closed
nitesh3539 opened this issue Aug 27, 2020 · 2 comments
Closed

Please add support for redirect and rewrite rules of Next Js #564

nitesh3539 opened this issue Aug 27, 2020 · 2 comments

Comments

@nitesh3539
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@nitesh3539 nitesh3539 changed the title Please support redirect and rewrite rules of Next Js Please add support for redirect and rewrite rules of Next Js Aug 27, 2020
@dphang
Copy link
Collaborator

dphang commented Aug 30, 2020

So there is redirects / rewrites list in routes-manifest.json after build, which has list of default redirects if you did not specify any (file with trailing slash -> file, and trailing slash redirect).

The plugin currently supports trailing slash redirect but it isn't using the default list, rather it is just checking for trailingSlash prefix or not for better performance.

For custom redirects/rewrites, we could read from routes-manifest.json and if there are any besides the defaults (trailingSlash 308 redirect) or defaults have changed (e.g you want a status other than 308), then use those instead. For perf reasons, probably best to do this after knowing the request is not matched to any other routes (i.e it would have otherwise gone to a 404 page), so the regex doesn't run for all requests to the Lambda.

@dphang
Copy link
Collaborator

dphang commented Sep 9, 2020

Closing in favor of: #587. Please follow that thread for updates.

@dphang dphang closed this as completed Sep 9, 2020
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