I have an url like http://demo.examplesite.com/videos/9#part-1
How can i change this to http://demo.examplesite.com/videos
please provide solution for this
I have an url like http://demo.examplesite.com/videos/9#part-1
How can i change this to http://demo.examplesite.com/videos
please provide solution for this
In order to change the url structure you must edit the url manager in /protected/config/main.php. Below is an example of the url manager (these settings have been changed).
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName' => false,
'rules'=>array(
// custom rules go first
'product/<slug:[a-zA-Z0-9-]+>/'=>'product/view',
// default controller url setup
'<controller:w+>/<id:d+>'=>'<controller>/view',
'<controller:w+>/<action:w+>/<id:d+>'=>'<controller>/<action>',
'<controller:w+>/<action:w+>'=>'<controller>/<action>',
// defaults to a site page if not above
'<view:[a-zA-Z0-9-]+>/'=>'site/page',
),
),
You will need to first understand how to use the url manager in order to craft them to your needs. As @jurik mentions in the comments, 9 likely relates to the video and therefore this url is already pretty friendly.
The code above was taken from this guide. I would recommend you read this in order to advance.
http://www.joshuawinn.com/yii-clean-seo-friendly-urls-for-pages/