Current project (I’ve used Yii1 & 2 for several projects) is Angular IO in the front-end and Yii is mainly used to provide a REST API to Angular (plus some views that produce CSV or PDF downloads).
Some bots like to try and break in so they produce InvalidRouteException which goes into @runtime/logs/app
We monitor this log closely, as any PHP bug we put into our code will show up here. We like to fix bugs before the user reports them
So I try to remove nuisance stuff from this log, keep it clean.
So I’m looking for a way to handle this exception and redirect to the application’s home page, preferably without modifying core Yii.