Route works only in debug mode


I have a route in my controller (in the AppBundle) with the Symfony annotation. Action in controller has
* @Route(“myroute”)

routing.yml is like this:
resource: “@AppBundle/Controller/”
type: annotation
prefix: /

This works like a charm…until I switch off debug mode. So it works in debug mode, but if I switch off debug mode, I get an error 404. Anybody an idea why this route only works in debug mode?


did you try to clear the symfony cache for production environment?



First thing I’ve tried :wink: