I am using Vue router with history mode. On button click on the current page I route it to next page. On second page when i reload i get a 404. Is there a way to handle this in Vue and redirect it to home page.
export default new Router({
mode: "history",
routes: [
{
path: "/",
name: "first",
component: First
},
{
path: "/abc",
name: "abc",
component: Second,
props: true
},
index.html
so that your server knows to serve your application from all routes. If you are serving the application from all routes and Vue isn't rendering the component you wish then your vue-router configuration needs to be updated. – stwilz