Symfony4 Route not found with path param if contains a dot

亡梦爱人 提交于 2020-01-06 07:24:14

问题


If I navigate to this route with this slug (/client/example.com)

/**
 * @Route("/client/{url}")
*/

I get this error

The requested resource "/client/example.com" was not found on this server.

I'm using php built-in server php -S 127.0.0.1:8000 public/index.php

With this aproach it works but assets doesn't load properly php -S localhost:8000 public/index.php

Edit: without dot it works.

php bin/console router:match /client/example.com
[OK] Route "client_show" matches

php bin/console router:match /client/example
[OK] Route "client_show" matches

回答1:


As Lawrence Cherone stated in the comments looks like it doesn't work with the built-in php server but it does work with the composer require server included in Symfony Recipes.

php bin/console server:run


来源:https://stackoverflow.com/questions/50053120/symfony4-route-not-found-with-path-param-if-contains-a-dot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!