REST api problem with getting single model


In my project I use backbone.js + marionette and Yii2

But I have some problem with REST api.

I have separated module named “shop” with main page (it’s a simple page for bootstrap all needed scripts and other data)


in this module i also want use REST api for loading data for models and collection

part of my config

'components' => [

        'urlManager' => [

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

            'enablePrettyUrl' => true,

            'enableStrictParsing' => true,

            'showScriptName' => false,

            'rules' => [

                ['class' => 'yii\rest\UrlRule', 'controller' => 'products'],



        'request' => [

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

            'parsers' => [

                'application/json' => 'yii\web\JsonParser',




When I’m getting collection

curl -i -H ‘Accept:application/json’ -X GET ‘account.local/shop/products’

It’s ok


But when I try get single model - 404!!!

curl -i -H ‘Accept:application/json’ -X GET ‘account.local/shop/products/16’

Maybe I do something wrong???

I can not see any obvious mistake.

Could you please post the products controller code and .htaccess?!