score:3

Accepted answer

To change default admin prefix in url you need to update in routing.yml first which i guess by reading comments you already have done, second thing to you need change this in security.yml also by changing the admin firewall pattern and access_control rules, if needed clear your cache too after applying below changes

Routing

admin_area:
    resource: "@SonataAdminBundle/Resources/config/routing/sonata_admin.xml"
    prefix: /panel

_sonata_admin:
    resource: .
    type: sonata_admin
    prefix: /panel

sonata_user:
    resource: '@SonataUserBundle/Resources/config/routing/admin_security.xml'
    prefix: /panel

Firewall

security:
    firewalls:
        admin:
            pattern:            /panel(.*)
            context:            user
            form_login:
                provider:       fos_userbundle
                login_path:     sonata_user_admin_security_login
                use_forward:    false
                check_path:     sonata_user_admin_security_check
                failure_path:   null
            logout:
                path:           sonata_user_admin_security_logout
                target:         sonata_user_admin_security_login
            anonymous:          true

    access_control:

        # Admin login page needs to be access without credential
        - { path: ^/panel/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/panel/logout$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/panel/login_check$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/panel/, role: [ROLE_ADMIN, ROLE_SONATA_ADMIN] }

Related Query

More Query from same tag