Answer the question
In order to leave comments, you need to log in
Yii urlManager hide 'index.php/site' from link?
I can't remove 'index.php/site' from the link in any way,
Now it's like this: localhost/yii/cya/index.php/site/restaurants
Need: localhost/yii/cya/restaurants
Standard rule:
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
'< controller:\w+ >/< id:\d+>'=>'< controller >/view',
'< controller:\w+ >/< action:\w+>/'=>'< controller >/< action >',
'< controller:\w+ >/< action:\w+>'=>'< controller >/< action >',
),
),
Answer the question
In order to leave comments, you need to log in
Here is the solution:
Options Includes FollowSymLinks
#hide index.php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
// стандартное правило для обработки '/' как 'site/index'
'' => 'site/index',
// это пример добавления который заработал
//'secondcontroller/<action:.*>'=>'secondcontroller/<action>',
'user/<action:.*>'=>'user/<action>',
//'<action:.*>'=>'site/<action>', //закомментил а то глючило с ним
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question