0
Yii的蛞蝓因此,使用警予我想擁有的網址是這樣的:使用URL經理
mydomain.com/some-short-slug
此URL映射如下:
mydomain.com/book?bookslug=some-short-slug
我怎樣才能做到這一點?
Yii的蛞蝓因此,使用警予我想擁有的網址是這樣的:使用URL經理
mydomain.com/some-short-slug
此URL映射如下:
mydomain.com/book?bookslug=some-short-slug
我怎樣才能做到這一點?
你需要做的這裏面的網址經理:現在
'urlManager' => array(
'urlFormat' => 'path',
'showScriptName' => false,
'caseSensitive' => false,
'rules' => array(
...
'<slug>'=>'book/index'
...
),
,如果URL像mydomain.com/some-short-slug
,您在actionIndex
BookController
的
你也將有
$slug
等於「有些短,彈頭」需要一個.htaccess文件或等效的單一入口點重定向,如Yii文檔中所述 - http://www.yiiframework.com/doc/guide/1.1/en/topics.url#hiding-x-23x – JamesG作品完美,謝謝很多男人:) – RicardoE
不客氣!很高興聽你這樣說 :) – hamed