This one is using for removing index.php and also remove site portion from URL.
I am trying to remove index.php from the URL string for so many times. Finally i got some cases in which i want to share with you guys.
Verify mod_rewrite is enabled in your server you can check it to load php.ini file.
Just copied following code and paste into urlManager in main.php
Here's what I put under components file main.php:
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
//'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
'/'=>'site/index',
'blog'=>'post/index',
'<view:(about)>'=>'site/page',
'contact'=>'site/contact',
'login'=>'site/login',
),
//'urlSuffix'=>'.html',
),
Also,
You can make your own rule to your web page need:
Here, i have changed site/login to login and site/contact to contact.
Also , post/index to blog as you can see in the rules array.
Hope this is one helps you in many ways.