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

Opt out from rewrite #618

Closed
mochetts opened this issue Nov 11, 2023 · 1 comment
Closed

Opt out from rewrite #618

mochetts opened this issue Nov 11, 2023 · 1 comment
Labels
enhancement New feature or request unconfirmed Needs triage.

Comments

@mochetts
Copy link

mochetts commented Nov 11, 2023

Is your feature request related to a problem? Please describe.

I have another middleware that performs a rewrite to /app when the request host is app.myhost.com. This rewrite is colliding with the rewrite that next-intl performs.

Given that NextJS only allows 1 middleware rewrite in the request lifecycle. Isn't it too much for the library to consume that single intent?

Is there a way to solve this without using a rewrite within next-intl?

Is there a way to solve this without needing to change anything in next-intl?

Describe the solution you'd like

Add a way to opt out from the rewrite and do a redirect instead

Describe alternatives you've considered

Been trying to solve this issue by parsing and massaging the response that the next-intl middleware returns with no success.

@mochetts mochetts added enhancement New feature or request unconfirmed Needs triage. labels Nov 11, 2023
@amannn
Copy link
Owner

amannn commented Nov 12, 2023

There was a similar request recently here, maybe this helps: #573. Generally, the middleware is composable, allowing e.g. rewrites on top before processing a request.

Rewrites seem to be a common request, I've added an example for rewrites to the middleware docs of the release candidate, which are expected to be published soon. Hope this helps!

@amannn amannn closed this as completed Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request unconfirmed Needs triage.
Projects
None yet
Development

No branches or pull requests

2 participants