{"action":"created","issue":{"url":"https://api.github.com/repos/thephpleague/route/issues/25","labels_url":"https://api.github.com/repos/thephpleague/route/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/thephpleague/route/issues/25/comments","events_url":"https://api.github.com/repos/thephpleague/route/issues/25/events","html_url":"https://github.com/thephpleague/route/issues/25","id":58645998,"number":25,"title":"Catch all route","user":{"login":"felixkiss","id":256075,"avatar_url":"https://avatars.githubusercontent.com/u/256075?v=3","gravatar_id":"","url":"https://api.github.com/users/felixkiss","html_url":"https://github.com/felixkiss","followers_url":"https://api.github.com/users/felixkiss/followers","following_url":"https://api.github.com/users/felixkiss/following{/other_user}","gists_url":"https://api.github.com/users/felixkiss/gists{/gist_id}","starred_url":"https://api.github.com/users/felixkiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixkiss/subscriptions","organizations_url":"https://api.github.com/users/felixkiss/orgs","repos_url":"https://api.github.com/users/felixkiss/repos","events_url":"https://api.github.com/users/felixkiss/events{/privacy}","received_events_url":"https://api.github.com/users/felixkiss/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-23T20:51:48Z","updated_at":"2015-03-04T15:04:36Z","closed_at":"2015-02-23T20:57:25Z","body":"Is there a way to add a catch all route that deals with every request that doesn't match one of the other specified routes.\r\n\r\nSomething like this:\r\n\r\n```php\r\n$router->addRoute(\r\n    'GET', '/foo',\r\n    function(Request $request, Response $response)\r\n    {\r\n        // handles GET /foo\r\n    }\r\n);\r\n\r\n$router->addCatchAllRoute(function(Request $request, Response $response)\r\n{\r\n    // handles everything else, e.g. POST /foo\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/thephpleague/route/issues/comments/77173471","html_url":"https://github.com/thephpleague/route/issues/25#issuecomment-77173471","issue_url":"https://api.github.com/repos/thephpleague/route/issues/25","id":77173471,"user":{"login":"patrickheeney","id":1407228,"avatar_url":"https://avatars.githubusercontent.com/u/1407228?v=3","gravatar_id":"","url":"https://api.github.com/users/patrickheeney","html_url":"https://github.com/patrickheeney","followers_url":"https://api.github.com/users/patrickheeney/followers","following_url":"https://api.github.com/users/patrickheeney/following{/other_user}","gists_url":"https://api.github.com/users/patrickheeney/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickheeney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickheeney/subscriptions","organizations_url":"https://api.github.com/users/patrickheeney/orgs","repos_url":"https://api.github.com/users/patrickheeney/repos","events_url":"https://api.github.com/users/patrickheeney/events{/privacy}","received_events_url":"https://api.github.com/users/patrickheeney/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T15:04:36Z","updated_at":"2015-03-04T15:04:36Z","body":"@philipobenito Here are some suggestions:\r\n\r\nLaravel way:\r\n```\r\nRoute::any('(.*)', function($page) {\r\n    dd($page);\r\n});\r\n```\r\nOr\r\n```\r\nRoute::any('(:any)/(:all?)', function($first, $rest=''){\r\n    $page = $rest ? \"{$first}/{$rest}\" : $first;\r\n    dd($page);\r\n});\r\n```\r\n\r\nMaybe something event related? Catch a RouteNotMatched route and be able to easily forward the call onto another route?\r\n\r\nMaybe a catch-all strategy that only gets called after routes do not match in a last attempt to get a response?"}}