I'm having a problem with createWebHistory #1832
-
When I pass in the parameter createWebHistory('/a/b'), my url redirects from localhost/a to localhost/a/b/a, I actually need it to become localhost/a/b, how should I configure it |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You shouldn't worry about this: In practice, this feature allows your website to be hosted in any subdirectory of a website If what you want to add is a prefix to all routes, do that in the routes themselves: routes: [
{ path: '/app', children: [
// actual routes
]}
] |
Beta Was this translation helpful? Give feedback.
You shouldn't worry about this: In practice, this feature allows your website to be hosted in any subdirectory of a website
example.com/app/
needs/app
as a base. In this scenario, your users always enter your application throughexample.com/app
, any other subdirectory will serve a different page without your application.If what you want to add is a prefix to all routes, do that in the routes themselves: