Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Minus in url make router crash

Hello! I have a small problem with automating routing, when I type in browser www.site.com/anything/anything-with-minus, router display index action of controller index and action index, if I replace minus with underscore, I get 404 as normal. Router is set in auto mode, not a single route added. How can fix this ? Thanks



2.3k
Accepted
answer

Solved by adding:

$router->notFound([ "controller" => "index", "action" => "notFound", ]);