Создал модули: default(модуль по умолчанию(Главная страница)), admin, user, article, news, comment.
Все что было в корне приложения в каталогах controllers, models, views по удалял.
Теперь при неправилном вводе урл, вместо Error 404 со стилем сайта, вылазит это:
CHttpException
Невозможно обработать запрос "site/error".
//на пустой страницы, даже без оформления как html.
Из за чего может быть такая работа?
Вот конфиг файл:
<?php
// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
'language'=>'ru',
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'Yii Blog Demo',
// preloading 'log' component
'preload'=>array('log'),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
),
//Modules
'modules'=>array(
'default',
'article',
'news',
'user',
'admin',
'comment',
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'pass',
),
),
'theme'=>'classic',
// Controller default
//'defaultController'=>'default',
//Module Default
'defaultController'=>'default/default',
// application components
'components'=>array(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
/*
'db'=>array(
'connectionString' => 'sqlite:protected/data/blog.db',
'tablePrefix' => 'tbl_',
),*/
// uncomment the following to use a MySQL database
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=yiiblog_native',
'emulatePrepare' => true,
'username' => 'root',
'password' => 'pass',
'charset' => 'utf8',
'tablePrefix' => 'tbl_',
),
'errorHandler'=>array(
// use 'site/error' action to display errors
'errorAction'=>'site/error',
),
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'urlSuffix'=>'.html',
'rules'=>array(
/*'post/<id:\d+>/<title:.*?>'=>'post/view',
'posts/<tag:.*?>'=>'post/index',*/
'<module:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>' => '<module>/<controller>/<action>',
'<module:\w+>/<controller:\w+>/<action:\w+>'=>'<module>/<controller>/<action>',
/*'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',*/
),
),
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
// uncomment the following to show log messages on web pages
/*
array(
'class'=>'CWebLogRoute',
),
*/
),
),
),
// application-level parameters that can be accessed
// using Yii::app()->params['paramName']
'params'=>require(dirname(__FILE__).'/params.php'),
);