Few questions about pretty url and assets in Yii2

Hello, I have got two questions, can anybody help me?

  1. I switch on pretty urls in config:

'urlManager' => [

            'enablePrettyUrl' => false,

            'showScriptName' => false,

            'enableStrictParsing' => true,

            'rules' => [

                // ...

            ],

        ],

and my site stop working, with this .htaccess too: http://www.yiiframework.com/doc-2.0/guide-tutorial-shared-hosting.html

I see 404 on all of the pages. Url structure start to bee pretty, but nothing works. Why? What I must to do and what I doing wrong?

  1. In assets I can include js scripts and they will be on any page of the site. Can I include js or css only for one page? How I can do it? I didn’t found nothing in documentation about it.
  1. Probably your .htaccess isn’t read by webserver.

  2. Yes. Include it in a specific view or controller action.