Wordpress like slug

Hi,

I have create URL for PageController like in wordpress, as example:

site.com\:slug

Will be handle PageController if page with this slug not found, other routes will be processed.

I will be grateful for any idea.

that looks like a catch all route, you can put more specific routes above it so it is triggered down below after no other route matched

2 Likes

I think you usually do it backwards: match known static routes (/about, /faq, /pricing, etc.) and process it as slug as a catch-all in the end. Throw 404 if the slug is not found.

2 Likes