class AppBootstrap implements \yii\base\BootstrapInterface {
public function bootstrap($app) {
$app->on(\yii\base\Application::EVENT_BEFORE_ACTION, function($event) use ($app) {
if (/*** Some check ***/) {
/*** Redirect here ***/
}
});
}
}