Symfony’s routing system is pretty easy to understand, however, what happens when you need a default, catch-all route that doesn’t match any other routes? Instead of sending a customer to a 404, you can redirect them to a default path, in this case, it’s the root path “/” (defined in the line “path: /” below) but it could be another path if you’d like. Remember that the order of the routes are important and take precedence over ones Symfony encounters later down the routing directives list.
defaultCatchAll: path: /{path} defaults: _controller: FrameworkBundle:Redirect:urlRedirect path: / permanent: true requirements: path: ".+"
Visit Symfony’s documentation for more details:
http://symfony.com/doc/current/cookbook/routing/redirect_in_config.html
http://symfony.com/doc/current/cookbook/routing/slash_in_parameter.html