Url manager

Hello all.

Install yii2 basic from composer.

in config/web.php add




'urlManager' => [ 

'class' => 'yii\web\urlManager', 

'enablePrettyUrl' => true, 

'showScriptName' => false, 

],



in /web/ create file .htaccess and add




AddDefaultCharset utf-8

Options +FollowSymLinks

IndexIgnore /

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php



don’t work ‘showScriptName’ => false

in url: bapp.local /site /index

on page: The requested URL /site/index was not found on this server.

Try addding some rules to it:


    	'rules' => [

        	'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',

        	'<controller:\w+>/<action:\w+>' => '<controller>/<action>',

    	],



don’t work it too.

I used to try




'rules' => [

                '<_c:[\w\-]+>/<id:\d+>' => '<_c>/view',

                '<_c:[\w\-]+>' => '<_c>/index',

                '<_c:[\w\-]+>/<_a:[\w\-]+>/<id:\d+>' => '<_c>/<_a>',

],



but all not work

In options virtual host add




<Directory c:/site/bapp> 

        Options FollowSymLinks

        AllowOverride All

</Directory> 



and all works