1'urlManager' => [
2 'class' => 'yii\web\UrlManager',
3 // Disable index.php
4 'showScriptName' => false,
5 // Disable r= routes
6 'enablePrettyUrl' => true,
7 'rules' => array(
8 '<controller:\w+>/<id:\d+>' => '<controller>/view',
9 '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
10 '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
11 ),
12],
1RewriteEngine on
2# If a directory or a file exists, use it directly
3RewriteCond %{REQUEST_FILENAME} !-f
4RewriteCond %{REQUEST_FILENAME} !-d
5# Otherwise forward it to index.php
6RewriteRule . index.php