What Happens If No Rule Applied In The Url Manager Rules?

In the main configuration file, I changed the URL Manager component configuration like the following:





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?

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:



   '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.