-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 not working with node adapter (or documentation missing) #11412
Comments
Hello @pReya. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
Hey @pReya, even if the repro doesn't work in stackblitz, please create a stackblitz so we can download it and test it locally. |
Added one in the opening post. |
It seems to be a bug in our documentation. I will raise a PR to address that. The routing priority favours the file system, and in this case Here's the initial proposal: https://github.com/withastro/roadmap/blob/main/proposals/0041-redirects.md#routing-priority |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
I have configured redirects in my
astro.config.mjs
. For these redirects, I have also a static page/astro file that matches the same route. Locally in my dev server, the redirects work and seem to have priority over my.astro
file. However they do not work in my live deployment, when using the Node adapter. There it seems that either the redirects are buggy/not generated - or the static page wins over the redirects in terms of priority. Either way, the behavior on prod differs from the behavior on dev. If this is intentional, I wish this was documented somewhere. In general, the documentation for the priority is "configured" redirects is nowhere to be found.Here is my config:
Visiting
https://subdomain.apps.myproject.de/de/admin
will NOT redirect me tohttps://subdomain.apps.myproject.de/de/admin/projects
as intended. Instead, it will serve the static page/astro file, which can be found under/de/admin/index.astro
. Maybe this is a priority issue? From the documentation it's not clear to me, who will win, if there is both a configured redirect AND a.astro
file/page for the same path. I can't find anything about redirects in the documentation section Route priority order.What's the expected result?
Redirect should work in Node environment, too.
Link to Minimal Reproducible Example
Can't reproduce completely on Stackblitz, because the behavior is different on the dev server vs deployment via the node adapter. Anyway, here's a Stackblitz: https://stackblitz.com/edit/github-wg2t3j
Participation
The text was updated successfully, but these errors were encountered: