In the main configuration file, I changed the URL Manager component configuration like the following:
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array()
)
Now if I request the following URL: servername/controller/action, the YII framework tried to call the "action" in the "controller" although no rule was applied !!
How I can prevent this?
konapaz
(Konapaz)
December 27, 2012, 1:42pm
2
Hi Luay Essa
There is a default-standard rules when the urlmanager is enabled (even with empty rules)
the default rule (by Yii) is the <module>/<controller>/<action> route, So you have to comment entire ‘urlManager’ if you want to disable it
Hi KonApaz,
Thank you very much for your response. But I think it is not correct for the URL Manager component to work like this.
Suppose I have the following configuration:
'urlFormat'=>'path',
'rules'=>array(
'message/save/<Id>' => 'action/save',
)
Now this request ‘//servername/message/save’ will be routed to ‘message/save’ even though no rule was applied.
I think the correct behaviour is to response with 404 error code.