URL Rewrites
#28649
Replies: 1 comment 5 replies
-
|
Use route rules or in-server fetch |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
After doing quite a bit of research it seems like this is not possible at the moment, and before moving forward I would like to point out that this has some very valid use cases and I am not speaking of redirects.
There is a useful feature called url rewrites where a user can visit
/fooand the content of/baris returned, while the url stays/foo.Why is this so useful? One of the biggest reasons I can come up with for this is for
A/B Testing.Using
netlifywithnuxtworks great and they already support url rewrites.If we had the following file structure:
Using netlify edge functions, we can visit
/fooand the content of/barwill be returned, but then the url updates to/bar. This happens also using alias which I personally find a bit confusing.A/B testing would be the perfect use case for something like this because two different layouts could be served for a product page and the url wouldn't change.
Nuxt route rules with the
proxyoption do not work because vue router matches the component and updates the url.Beta Was this translation helpful? Give feedback.
All reactions