We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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



6.0k
Accepted
answer

Solved by adding:

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