path regex [question]
Opened this issue · 1 comments
alfaex commented
I'm having such a hard time with the redirection option.
Can you post more example on the docs please?
steps: [ { path: '/home/books', orphan: true }, { path: '/home/books', redirect: function () { document.location.href = '/home/book-detail?book=761' } }, { path: RegExp('\/home\/book-detail\/[^/]+','i'), }
All sorts of things happens, like infinite redirects, of try to redirect to page like "http://home///book-detail//i/"
I trid a lot of things and nothing works.
Thanks
riki137 commented
i had the same problem as you.
the step you specified for redirect should actually be specified in the third step and not the second one.
like this:
steps: [
{ path: '/home/books', orphan: true },
{ path: '/home/books' },
{ path: RegExp('\/home\/book-detail\/[^/]+','i'), redirect: () => document.location.href = '/home/book-detail?book=761' } ,
...
]