request.ERROR: Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET /" request.ERROR: Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET /" symfony symfony

request.ERROR: Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET /"


I had the exact same problem!!

Symfony2 has two generic routing files called:

app/config/routing.yml and app/config/routing_dev.yml

However, it also has a bundle specific routing file in each bundle. The standard procedure is to define all of your bundle routes in your bundle routing.yml file then reference this from the main routing.yml file by adding:

YourbundlenameMainBundle:resource: "@YourbundlenameMainBundle/Resources/config/routing.yml"prefix:   /

This is what I had and I was still getting the error. But then I read the error more closely... no route found for GET / .... then I checked my routing_dev.yml file and of course it had a route for / from the Acme demo bundle _welcome route. This is why it works for the dev version but not the prod version!

Solution:

Add a route for / to either your routing.yml global file or your routing.yml bundle file by adding the following:

_welcome:pattern:  /defaults: { _controller: YourbundlenameMainBundle:Default:index }

you can change index to some other route if your welcome page is not index


After you make sure you have your / route defined in any of your routing.yml

_welcome:pattern:  /defaults: { _controller: YourbundlenameMainBundle:Default:index }

clear your prod environment cache!

app/console cache:clear --env=prod


I had the exact same problem. And it was caused because of a missing bundel in the AppKernel.php.

A little late but you might try to change this line in the web/app.php:

$kernel = new AppKernel('prod', false);

to:

$kernel = new AppKernel('prod', true);

That will enable debugging and you should be able to find your problem. When fixed you will ofcorse need to change it back to false ;).

Hope this helps.