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
admin:
    resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
    prefix: /admin

_sonata_admin:
    resource: .
    type: sonata_admin
    prefix: /admin
User avatar
goyote
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
security:
    # ........   
 
    firewalls:
        # -> custom firewall for the admin area of the URL
        admin:
            pattern:      /admin(.*)
            form_login:
                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
            logout:
                path:           /admin/logout
            anonymous:    true
        # -> end custom configuration


See http://groups.google.com/group/sonata-users/browse_thread/thread/869f07b3eb6ea806 for more info.
illagrenan
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
mohammedeisa
Junior Member
 
Posts: 1
Joined: Thu Sep 11, 2014 2:29 pm