Yii debug mode - true: https://example.com/test (200)
Yii debug mode - false: https://example.com/test (404)
if(!defined('YII_DEBUG') || YII_DEBUG === false)
{
$disallowRoute = ['test','test/mode2','result2'];
foreach($disallowRoute as $route)
{
$config['components']['urlManager']['rules'][$route] = 'error/404';
}
}