This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

How to redirect /admin to /admin/dashboard

Discuss Symfony 2 bundles here

How to redirect /admin to /admin/dashboard

by goyote » Fri Dec 09, 2011 12:33 am

I installed the Sonata admin bundle, but the home page for it is on /admin/dashboard, how do I redirect entering /admin on the address bar to go to /admin/dashboard?

Current routes:

Code: Select all
    resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
    prefix: /admin

    resource: .
    type: sonata_admin
    prefix: /admin
User avatar
Junior Member
Posts: 29
Joined: Wed Jun 01, 2011 9:19 pm

Re: How to redirect /admin to /admin/dashboard

by illagrenan » Sat Mar 31, 2012 8:30 pm

I just had the same problem. This configuration works for me:

Code: Select all
    # ........   
        # -> custom firewall for the admin area of the URL
            pattern:      /admin(.*)
                provider:       fos_userbundle
                login_path:     /admin/login
                use_forward:    false
                check_path:     /admin/login_check
                failure_path:   null
                default_target_path: /admin/dashboard
                always_use_default_target_path: true
                path:           /admin/logout
            anonymous:    true
        # -> end custom configuration

See for more info.
Junior Member
Posts: 1
Joined: Sat Mar 31, 2012 8:21 pm

Re: How to redirect /admin to /admin/dashboard

by mohammedeisa » Mon Nov 17, 2014 11:45 am

Thank you illagrenan , that also worked for me :D
Junior Member
Posts: 1
Joined: Thu Sep 11, 2014 2:29 pm