Hello everyone, I am following the Yii book by Larry Ullman. I have written a .htaccess file and saved in my root folder. This is my .htaccess file:
<!ifModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1
</ifModule>
Then in the protected/config/main.php file, I set ‘showScriptName’=>false, like the following:
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'caseSensitive'=>false,
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
The problem is when I go to a strange path with strangecontroller eg when I go to localhost/mysite.com/strangecontroller it gives me an error:
CHttpException
Unable to resolve the request "strangecontroller".
The problem is I want to load the default controller and the default action but it gives giving me that error.
Please help! Thanks in advance.