Router to catch all

Does anybody know how to make a router to catch all pages on a domain? Looking at all the documentation and API I can only see how to create a router with a prefix, so it will only check sub pages under that prefix…

Ultimately I am looking to check if a requested page exists on the domain in order to trigger custom 404 behaviour

Maybe you need more flexibility, but you are aware that Wix supports custom 404 pages without Corvid?

https://support.wix.com/en/article/customizing-your-404-error-page

Thank you Lee, but yes I was aware of this, and I’m looking for more flexibility and some custom code that runs. Having looked in detail, I’m not sure it is possible to have a router for ALL pages, looks like it must have a prefix & associated dynamic page, but I’d be glad for someone to correct me on that!

Hello @aquacruise

Indeed routers catch only pages that are within the router itself and do not affect the rest of the website.

As stated by Lee, you can use a custom 404 page and have your code run in there. Would that work?

Hello.
I didn’t know about custom 404 page. But I think, you can use it, just run code that will redirect user to correct router url and then decide what page should be showed.
I will use this in my wix project also :slight_smile: