In config file URL Manager should be in component array like this:-
'components'=>array(
---------------,
---------------,
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
'post'=>'post/list',
'post/<id:\w+'=>'post/read',
),
'showScriptName'=>false,
'caseSensitive'=>false,
),
---------------,
---------------,
),
In config file Modules should be in main array like this:-
return array(
---------------,
---------------,
'modules'=>array('module1','module2',.....),
---------------,
---------------,
);
For rewriting the URL following things should be done in httpd file of Apache:-
1] mod_rewrite module should be uncommented.
2] In <Directory> section AllowOverride None should be replaced with AllowOverride All.
3] Application directory must contain a .htaccess file with following code:-
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
RewriteBase /Your Application Directory Name/
# 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
You can also take the help of following links:-
http://www.yiiframework.com/doc/guide/topics.url
Definitely all these will help you.
It’s working for me perfectly.