title: Yii2: How to redirect on invalid routes?
body: <p>Instead of showing an error page I'd like to redirect the user to the start page in general, if the route is invalid (there is no controller/action like requested). To make it sound the redirection should only happen on 'normal' page requests. Though <a href="https://www.yiiframework.com/doc/api/2.0/yii-web-request#$isAjax-detail" rel="nofollow noreferrer">AJAX calls</a> can be invalid as well, I don't want to send a redirect to the browser here.</p>
  
  <p>How can I do this efficiently?</p>