Decided to learn php framework - Yii2.
But faced with the problem of routing.
Here is what I have:
config / web.php
... 'components' => [ 'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'enableStrictParsing' => true, 'rules' => [ '/' => 'site/say', 'site/contact' => 'site/say' ] ], ... .htaccess
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php [L] controllers / SiteController.php
... public function actionSay($message = 'Привет') { return $this->render('say', ['message' => $message]); } ... views / site / say.php
<?php use yii\helpers\Html; $this->title = 'Say'; ?> <?= Html::encode($message) ?> The localhost root points to the basic/web directory. At the request of localhost everything starts normally, the say template is displayed, but at the request of localhost/site/contact error 404 is displayed, the page was not found.
What could be the problem?