问题
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