New action require to disable enablePrettyUrl!?


All the rest actions works fine (delete,view,update,add) with ‘enablePrettyUrl’ enabled, but my custom action wont work until I disable the ‘enablePrettyUrl’ … is that normal … do I need to fix it ?


You are probably doing something different with your action.

What do you mean by ‘wont work’? Getting an error, does not return what you want, page not found?

Without detailed information, we can give meaningful answers.

Can you show us the code for your action? Otherwise, all we can do

is make wild guesses. And that just wastes time…


Sorry bro …

The issue was that with pretty url was giving error 404, disabling it the action was showing normal with non-pretty url.

This been solved, it bit strange … disabling ‘enableStrictParsing’ and enabling it again solved the issue, now the action works with pretty url.

Thanks for being helpful ;)

Now does not works …


                    'class' => 'yii\rest\UrlRule', 

                    'controller' => 'v1/country',

                    'pluralize' => false,

                    'extraPatterns' => [

                        'GET test' => 'test',




So, how ?