Hi, I need to set smart url following like this,
www.test.com/Hollywood/Movies/Furious_7
I don’t know, what i am doing and how to get url like this in config/main? and sitecontroller?
Anyone plz?
Hi, I need to set smart url following like this,
www.test.com/Hollywood/Movies/Furious_7
I don’t know, what i am doing and how to get url like this in config/main? and sitecontroller?
Anyone plz?
‘urlManager’=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
-- Remaining -- Code
),
add above code in main.php in config, use Yii::app()->createUrl() any were in your project
and also add some codes in htaccess file also se below
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.)\?$ index.php/$1 [L,QSA]
then you can archive your smart url
sorry with my bad english,
Happy Coding…
Thanks for your reply… Its working fine.
I have one more doubt, I need to get the name of "Hollywood" from the following url,
www.test.com/Hollywood/Movies/Furious_7
I don’t know how to get that name only in yii???
First of all i need url structure.
if you are using Module concept means use module name as HollyWood Other wise Use controller Name as HollyWood