HI ALL
I have this url:
khoavietnam.com/index.php/service/service/view/id/4
Now I want to change this url to:
khoavietnam.com/service/title-of-service-4.html
Please help me!.
thank you so much
Steve kein
HI ALL
I have this url:
khoavietnam.com/index.php/service/service/view/id/4
Now I want to change this url to:
khoavietnam.com/service/title-of-service-4.html
Please help me!.
thank you so much
Steve kein
http://www.yiiframework.com/doc/guide/1.1/en/topics.url
first of all, you enable url rewriting in the htaccess:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
then you put this in the protected/config/main.php:
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'urlSuffix'=>'.html',
'rules'=>array(
'service/<title:\w+>-<id:\d+>'=>'mycontroller/myaction',
)
)