I created a new bundle on a Symfony project, and I want to use the / route on a page such as:
JhebergUserBundle_homepage:
pattern: /
defaults: { _controller: JhebergUserBundle:Default:index }
On the production environment it works perfectly, but in development environment, it doesn’t. I always have the “Congratulations! You have successfully installed a new Symfony application.” page.
How can I rewrite the route on development environment ?
Thank you.
This is admittedly a tad confusing for newcomers to Symfony, because the homepage route isn’t found in
app/config/routing.yml. The route you are looking for is actually defined inapp/config/routing_dev.yml:Remove this route, and then define the homepage route anew in your respective bundle, and everything will work as expected.