Hi, i have a problem with urlManager. What i want is when i type http://example.com/careernews, it redirect to url http://example.com/careernews/index. I have tried login action in the SiteController, it works well and it redirects to site/login. But when i try other controller it won’t work. Any suggestion?
This is my urlManager config:
'urlManager' => array(
'caseSensitive' => false,
'showScriptName' => false,
'urlFormat'=>'path',
'rules'=>array(
'' => 'site/index',
'login' => 'site/login',
'<view>' => array('site/page'),
'careernews' => 'careernews/index',
'usermanager' => 'usermanager/index',
'<controller:\w+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
'<controller:\w+>/<id:\d+>/<title>'=>'<controller>/view',
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
),
),
and this is my .htaccess
Options +FollowSymLinks
IndexIgnore */*
<IfModule mod_rewrite.c>
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
</IfModule>
Thanks