Hi All,
I have seen that people always get difficulties in URL rewriting and hiding index.php from URL.
Try the following steps it will help you all:-
1] mod_rewrite module should be uncommented.
2] In <Directory> section AllowOverride None should be replaced with AllowOverride All.
3] Restart the apache server.
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,
),
---------------,
---------------,
),
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.