luyadev/luya

urlNormalizer don't work

Taroxx opened this issue · 3 comments

Hi,

I want to use yii2 UrlNormalizer, but there is no effect.

'components' => [     
        'urlManager' => [
            'class' => 'luya\web\UrlManager',
            'enablePrettyUrl' => true,
            'enableStrictParsing' => true,
            'showScriptName' => false,
            'suffix' => '/',
            'normalizer' => [
                'class' => 'yii\web\UrlNormalizer',
                'collapseSlashes' => true,
                'normalizeTrailingSlash' => true,
                'action' => UrlNormalizer::ACTION_REDIRECT_TEMPORARY,
            ],
        ]
]

I have tried every possible config settings, but it never works.
However, if changing the class of normalizer to some random string, will throw an error.
But any manipulations with other options is no effect.
I tried to pass normalizer to urlRule - is no effect.

nadar commented

hey @Taroxx

I never tested the UrlNormalizer, the CMS should already make correct urls without trailing slashes. In order to generate the LUYA CMS page paths we had to extend the UrlManager a little bit, therefore maybe thats why the normalizer won't work.

Could you please tell me your use case? What would you like to change?

nadar commented

What modules are you using? With CMS and Admin? only the core? Here for example you can see the CMS route which catches all requests in order to pass them to the CMS, maybe thats we. But i would have to take closer look at url normalizer, but until now i could not see the benefits of the normalizer.

https://github.com/luyadev/luya-module-cms/blob/master/src/frontend/components/CatchAllUrlRule.php

nadar commented

I am going to close this issue because:

  • Its a question (Please post questions at forum.luya.io)
  • Missing information's
  • No more activity
  • No one picked up the task (no Pull Request received)

If you think this is still important or there are more/new informations. Please reopen the issue and let us know.

If this is a problem or a feature you like to discuss, join our forum: forum.luya.io. We try to keep our issue tracker as clean as possible in order to focus on active issues.