symfony 2 No route found for “GET /”

后端 未结 7 1253
[愿得一人]
[愿得一人] 2020-12-17 09:54

Symfony2 returns No route found for \"GET /\" when I try to run http://localhost/app_dev.php, but this url works: http://localhost/app_dev.php/hello/Symfony. I removed AcmeD

7条回答
  •  庸人自扰
    2020-12-17 10:25

    The problem is that you don't have a route for /. Change your definition to this:

    ShopMyShopBundle_homepage:
        pattern:  /
        defaults: { _controller: ShopMyShopBundle:Main:index }
        requirements:
            _method:  GET
    

提交回复
热议问题