Disable Default Routing

How do I disable routing so the default module/controller/action routing does not work? I want to only allow routing for my custom rules. Even if I remove all the rules from the UrlManager in main.php, it still maps routes to module/controller/action.



you have write code in main.php




    	'rules'=>include('route.php'),// same location - with main.php


you have to write own rule in route.php file.


I’m not looking to add new url rules to main.php. I want to ONLY use my custom rules. So If I have a module called ‘pages’ with a default controller called ‘default’ and an action called ‘index’, and I request ‘mysite.com/pages/default/index’, I want it to return a 404. There is a default routing schema that yii I’m trying to disable.

Turn on strict parsing:


Should trigger a 404. ;)

You nailed it again! Thanks!