What I am looking for is a way to implement MVC without needing the controller specified in the uri. The problem I am finding is that the only way I can have a simple url like example.com/blue-widget is if I first query the database to determine if the product table has the custom uri specified of "blue-widget" if it returns a row at all I can then route to the product controller. The problem with this method is that I have to query each table and then check if any rows are returned to determine which controller to route to. This feels like overkill. Especially if I end up needing more than a handful of controllers.
I would like to keep the traditional functionality of a typical MVC application so that the routing is controller/action/arguments. I simply want to add the feature so that the routing portion could determine what controller to use based on a custom-uri preferably without needing to query the database, but if that is the only option I will have to accept that and maybe minimize it to a single query that determines which table it is found in.
In short traditionally for me to access the product page of blue-widget I would need to have a url at minimum like this:
example.com/product/blue-widget
What I am looking for is a url like this:
example.com/blue-widget
but having some sort of logic to determine if the uri blue widget is a product, or a page, or a category etc without needing to create any kind of map of every possible custom uri.
This is a custom MVC implementation and not based on any particular framework.