Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 4 routing with optional placeholder

I am fairly new to Codeigniter and have a problem with routing when passing a parameter.
The problem is that the parameter I need to pass is a variable not always present.
Essentially I need the following two cases to be valid when routing


But cannot have them both at the same time in the Routes.php file.
How can I have the above two cases coexist at the same time?

Thanks for your help.

Try reversing the two  routes because as soon as an exact match is found the routes stop searchingSmile

Such simple solution!! Works perfectly.
Thanks so much! You made me save a lot of time

Theme © iAndrew 2016 - Forum software by © MyBB