-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Configured Redirects with more than two params don't expand properly #8914
Comments
While trying to find a workaround (basically, using a single rest route), I realized that the problem was somewhat more complex than the issue would make it think. For instance, even when a single param 'route'/'redirect config' (a rest one though) is concerned, the redirection may not work. For instance with the following redirects configuraiton '/ot/old-page/[...pageuser]': '/play/ot/new-page/[...pageuser]',
Not sure how to complete, modify the issue to somewhat extend the scope of the problem. |
|
Yeah, seems like it. Although the two issues may have the same cause: "..." being included in some match and replace maybe. |
I don't think that is the case. I think what you may be missing is the fact that the target route needs to exist for the expansion to work. For example, for this redirect rule to expand properly... '/ot/old-page/[...pageuser]': '/play/ot/new-page/[...pageuser]', ...the target route named |
I think I may have similar issue (using storyblok CMS + i18n)
PS both '/de-de' and '/de' paths are generated in getStaticPaths() in [...slug].astro |
@nastiazhyrnova Can you share what adapter you are using, and what your |
@lilnasy adapter is
env.SSR I tried both false and true, it doesn't change anything in this case... Regarding the folder structure, it is actually |
Thanks, this really helps. |
Hi @lilnasy I've tried it, but unfortunately it doesn't work :( Moreover, if I also remove [...slug].astro from |
How about we:
|
@rishi-raj-jain so far I see it as an only solution, in my case it is some middleware in Vercel, have to have a look at it |
That is the plan. The logic would go here: #9089 (comment). The information we have is Normally, this generate function is already there but it comes from the target route. In this case, the target route is named differently so it is not available. Ideally, we would refactor |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Context
Redirects configuration in
astro.config.mjs
Tested usint the following configuration (however certainly not limited to this configuration):
Bug
Redirects entries with more than one param (ie: '/ov/[page]/[...user]': '/tests/ov/[page]/[...user]') don't work.
The expansion does not take place.
Example:
Given the following configuration:
will redirect properly to
While
will redirect without expanding the params to
What's the expected result?
Given the configuration above,
Should redirect to
Instead of
Link to Minimal Reproducible Example
https://github.com/lilnasy/redirect-issue
Participation
The text was updated successfully, but these errors were encountered: