Answer the question
In order to leave comments, you need to log in
How not to duplicate url using yii?
Included in Yii CNC.
Now you can go to the main page
If I write $this->createUrl('site/index'); then in the url I get sitename.ru/site/index.
How to setup urlManager so that $this->createUrl('site/index'); get on sitename.ru?
Answer the question
In order to leave comments, you need to log in
Just enter an alias
array(
// стандартное правило для обработки '/' как 'site/index' - это ваше
'/' => 'site/index',
// стандартное правило для обработки '/login' как 'site/login' и т.д.
'<action:(login|logout|about)>' => 'site/<action>',
// своё правило для URL вида '/Производитель/Модель'
array(
'class' => 'application.components.CarUrlRule',
'connectionID' => 'db',
),
// стандартное правило для обработки 'post/update' и др.
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
),
site/indexbut just a slash
/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question