Ionic/Vue3 router default "Not found" 404 page

Hi these !

I was wondering how to properly do a URL redirect. The /** trick seems to not work.

So my goal is to redirect any page that do not match to /oops/notfound

Any idea ?

  {
    path: '',
    redirect: '/dashboard',
  },
  {
    path: '/**', // Not working
    redirect: '/oops/notfound'
  },
  {
    path: '/dashboard',
    component: Dashboard
  },
  {
    path: '/oops/notfound',
    component: NotFound
  },

Maybe this? http status code 404 - Vue-router redirect on page not found (404) - Stack Overflow

Thanks a lot @twestrick !

This is working :

{ path: '/:pathMatch(.*)*', derirect: '/notfound' },
// or
{ path: '/:pathMatch(.*)*', component: NotFoundPage },
1 Like