Symfony Sonata Redirect of the Root URL to the admin area

If you enter the user in the browser without a path ( to the admin area of Sonata ( wants to forward, this can be done very elegantly by means of a Symfony redirect in the routing.yml do:

  path: /
    _controller: FrameworkBundle:Redirect:urlRedirect
    path: /admin
    permanent: true

Comments are closed.