Skip to content

Routing issue with installation in a sub-directory #7129

Closed
@DHorchler

Description

@DHorchler

Symfony 2.1:

In parameters.yml I have
sub_dir: /mnc

In config.yml:

sonata:
resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
prefix: %sub_dir%/secured/admin
_sonata_admin:
resource: .
type: sonata_admin
prefix: /mnc/secured/admin

Up to here everything works fine, but if I use

sonata:
resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
prefix: %sub_dir%/secured/admin
_sonata_admin:
resource: .
type: sonata_admin
prefix: %sub_dir%/secured/admin

I get a route not found error.
I checked that in the latter case the line

if (0 === strpos($pathinfo, '/%sub_dir%/secured/admin')) {

is generated in the cache file appdevUrlMatcher.php, which should in fact be

if (0 === strpos($pathinfo, '/mnc/secured/admin')) {.

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions