I donβt think you might have a RegEx pattern in the route. keyword may need to have a specific RegEx pattern, but that's another matter.
If you are using YML, I think it is best to have two different routes:
route1: pattern: /{keyword} ... route2: pattern: /{keyword}/ ...
If you use annotations, you can put them at the top of the controller action:
/** * @Route("/{keyword}"); * @Route("/{keyword}/"); */
source share