Answer the question
In order to leave comments, you need to log in
How to remove duplicate URL in the rules of the UrlManager component without enableStrictParsing?
With this config
'components' => [
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'login' => 'user/login'
],
],
]
user/login
is called both when domain.com/login
and when domain.com/user/login
. How to remove the processing of the second URL without losing the functionality of the standard action call by matching the path and the controller (i.e. without enableStrictParsing = true
, in which each route has to be registered)?
Answer the question
In order to leave comments, you need to log in
https://www.yiiframework.com/doc/api/2.0/yii-web-u...
Whether to enable strict parsing. If strict parsing is enabled, the incoming requested URL must match at least one of the rules in order to be considered a valid request. Otherwise, the path information portion of the request will be treated as the requested route. This property is only used when enablePrettyUrl is set to true
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question