Error in Symfony2 when URL contains dot(.)
If you use a suffix, you should add it in the requirement of the route and use {_format} instead of "html" :
Example from the documentation :
article_show: path: /id/{title}.{_format} defaults: { _controller: AcmeDemoBundle:Article:show, _format: html } requirements: _format: html title: .+
EDIT :
You should avoid using dots (".") for your parameter. You should really use a slug of your title. But you could try in the requirements a regex to allow having dots in the title parameter.
requirements: _format: html title: .+
Old question, but since there still are old SF codebases out there, this may save up some time to someone.
This is an issue with how SF compiles the regex to match the routes. This applies at least to version 1.x and 2.x, not sure about newer versions.
In your routing.yml
you need to specify the expected format of your title
parameter under requirements
, as shown below:
my_route: url: /my_route/:id/:title param: { module: your_module, action: your_action } requirements: {title: .+}
Alternatively, instead of using requirements
, specifying the segment separator on your route also does the trick:
my_route: url: /my_route/:id/:title param: { module: your_module, action: your_action } options: { segment_separators: [/] }