Friday, September 4, 2015

The server returned a "404 Not Found"

Oops! An Error Occurred
The server returned a "404 Not Found".
Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused. 

Make sure you have the root / path in your routing.yml:

# vim app/config/routing.yml

my_demo_home:
    path:     /
    defaults: { _controller: MyDemoBundle:Default:home }

Clear the cache:

# php app/console cache:clear --env=prod

Clearing the cache for the prod environment with debug false

Check the routing:

# php app/console debug:router --env=prod

[router] Current routes
 Name                  Method Scheme Host Path
 my_home              ANY    ANY    ANY  /
 my_demo_hello        ANY    ANY    ANY  /demo/hello/{name}
 my_demo_home         ANY    ANY    ANY  /demo/
 homepage              ANY    ANY    ANY  /

No comments: