Default page for non existent dynamic page?

Hi there.
Still getting my head around this code thing.

My objective is to have a kind of ticket validation system. Valid ticket numbers (non sequential since they use a validation suffix) are inserted in a collection that also has Boolean value to record if that particular ticket has been scanned before.
Each ticket is accessed via it’s number generated dynamic link. The Boolean variable is set, so that if such number is accessed again an error message is displayed.
I would however like that if an invalid ticket number (not in the collection) is tried i could display some custom message instead of the generic 404.

I saw that you are unable to create custom 404 pages, but was wandering if it is possible to have some default action when non existent dynamic pages are accessed.

And if there is some alternative approach to doing this please let me know. My main objective for doing this way was to be able to generate custom links with the embedded ticket number, rather than having a page where you manually enter the ticket number.

Thank you

The wix-router API is a comprehensive and robust API for handling page requests, including various options such as redirect, reject, forbidden, and others. You can learn About Routers from the documentation.

A word of caution: The system you are describing is not trivial and will be a challenge for beginner coders. You might want to consider checking out the WixArena - which is a hub where you can look for Wix Code (and other) experts for hire.

Of course, you could accept the challenge and work on the code yourself. We are happy to get you pointed in the right direction, and as questions or difficulties arise, we are here to help.

Have fun,

Yisrael