Answer the question
In order to leave comments, you need to log in
Why am I getting 404 in router vue?
The project has the following structure
App.vue (inside router-view)
through it we get the home component
path: '/profile',
name: 'days',
component: () => import(/* webpackChunkName: "days" */ '../views/Home.vue'),
children: [
{
path: '/profile/day/:id',
name: 'day',
component: () => import(/* webpackChunkName: "day" */ '../components/Day.vue'),
}
],
http://stream/profile/day/1
Answer the question
In order to leave comments, you need to log in
Because your server is not configured.
You need to redirect all requests to the root (to /)
You are not getting the 404 code from the vue route, but from the server. Because there is no such page on the server.
Do as Sergei delphinpro advised you and everything will work.
p so you don't need to redirect all requests to /, but only those that fail, otherwise the resources will not be loaded.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question