I want to use like this url rule:
www.example.com/{CategoryName}
Then i added into frontend/config/main.php;
‘<seo:[\w-]+>’ => ‘news/index’,
‘<seo:[\w-]+>’ => ‘category/index’,
But this isn’t working that’s normal, I know, but i need this, i have to do, do you know about this something? How can i do?
Thanks for everything.
Solved:
$CategoryDetails = Category::findOne([‘category_seo’ => $seo]);
if (is_null($CategoryDetails)) {
$News = Yii::$app->createControllerByID('news');
return $News->actionIndex($seo);
throw new NotFoundHttpException('Sayfa Bulunamadı.');
}