request->pathInfo; if( $url == 'articles/' || $url == 'article/' || $url == 'article' ){ $queryString = \Yii::$app->request->queryString?'?'.\Yii::$app->request->queryString:''; $this->redirect('/articles'.$queryString, 301); return ''; } $news_query = \app\models\front\News::find()->joinWith('topics t') ->groupBy('news.id') ->andFilterWhere(['news.type'=>6]); return $this->render("index",["news_query"=>$news_query]); } public function actionView(int $id):string { $this->redirect('/news/'.$id, 301); return ''; } }