-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
routeRules
apply only to server responses
#19228
Comments
At the moment, routeRules are a purely server-side thing. They don't affect the behaviour of your client-side app once the initial SSR response has been made (except if you are continuing to make API calls or interact with the server). I think it would be a good idea to think about a unified interface though, so this kind of thing can flow over into the Vue app too, if desired. |
routeRules
Redirects Do Not Work With NuxtLink
Or Trailing SlashesrouteRules
apply only to server responses
Not sure if this is related, but ideally I would like to do:
This is so I can render my web application as a SPA and still render the server as a REST API. Specifically I am trying to do this with |
I switched all of my redirects to routeRules not realizing this. For the most part, it doesn't affect us as most redirects need to be handled server-side (e.g. a URL given out for marketing needs to redirect to a particular page). However, we have a few links on our site that use a shortened URL for SEO purposes, but that need to redirect to a dynamic page with contents determined by the route parameters. So until the routeRules work client-side, what is the recommended methodology? I feel like I've seen mixed answers online. And none of them are concise in format as routeRules unfortunately! As always, thanks in advance for your help, Daniel. |
Environment
Linux
v16.14.2
3.2.2
2.2.3
npm@7.17.0
vite
routeRules
-
-
Reproduction
https://stackblitz.com/edit/github-u1ewa9?file=pages/index.vue
Describe the bug
Using the
routeRules
part of the configuration to specify redirects only works when changing the URL, but not when using aNuxtLink
to navigate, and also does not work with trailing slashes, even though they should be allowed by default (and do work for normal navigation to existing pages).Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: