Answer the question
In order to leave comments, you need to log in
UrlManager stopped working in Yii2. Where to look for an error?
UrlManager stopped working in Yii2. Where to look for an error?
The debugger gives:
exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "login".' in Z:\home\yii.one\www\vendor\yiisoft\yii2\base\Module.php:462 Stack trace: #0 Z:\home\yii.one\www\vendor\yiisoft\yii2\web\Application .php(100): yii\base\Module->runAction('login', Array) #1 Z:\home\yii.one\www\vendor\yiisoft\yii2\base\Application.php(375): yii \web\Application->handleRequest(Object(yii\web\Request)) #2 Z:\home\yii.one\www\index.php(12): yii\base\Application->run() #3 { main} Next exception 'yii\web\NotFoundHttpException' with message 'Page not found.' in Z:\home\yii.one\www\vendor\yiisoft\yii2\web\Application.php:112 Stack trace: #0 Z:\home\yii.one\www\vendor\yiisoft\yii2\base\Application .php(375): yii\web\Application->handleRequest(Object(yii\web\Request)) #1 Z:
Tell me where to dig?
Answer the question
In order to leave comments, you need to log in
In web/.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
</IfModule>
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} ^/.*
RewriteRule ^(.*)$ web/$1 [L]
RewriteCond %{REQUEST_URI} !^/web/
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ web/index.php
</IfModule>
UrlManager:
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'' => 'site/index',
],
'user' => [
//'identityClass' => 'app\modules\users\models\Users',
'identityClass' => app\modules\users\models\Users::className(),
'enableAutoLogin' => true,
'loginUrl' => ['users/default/login']
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question