Ionic 3 - add a 404 page to URL Router

帅比萌擦擦* 提交于 2019-12-08 05:26:53

问题


In this Question I found a answer for 404 pages in Ionic 3 Routing: Custom 404 page Ionic 3

But I have a problem in my router when I use parameters. If I add this to my router:

{ component: EventdetailsPage, name: 'Details', segment: 'event/:eventId',defaultHistory: [HomePage] },

With this line at the bottom of my config, every call to a page with parameters will redirected:

{ component: NotFoundPage, name: "*", segment: ":**", defaultHistory: [NotFoundPage] },

on every call of .../event/123 it will redirect me to the 404 page. I tried a lot of combinations like -> segment: ":"/":"

but nothing works. Where can I find a 404 page solution that works with PWA Urls in Ionic.

来源:https://stackoverflow.com/questions/51305260/ionic-3-add-a-404-page-to-url-router

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!