Strange Behavior With Filtering After A Sort

I am encountering a very strange behavior with the GridView Sorting and Filtering. The filtering on its own works with no problems, and the sorting too. But after I sort, the filtering doesn’t update the search model with the filter values. After going through the code for hours I have encountered something very bizarre in the requests sent to the action from gridview during sorting.

URL Before sort:


URL on sort:


URL filter after sort:


I don’t even know where to start to find fix the issue. What I am seeing is that the the new filter GETs are appeneded to the old ones that are in the path format. I want to make filter and sort to have only path or only query string but not both. What can I do? My url manager is pretty simple:

'urlManager' => ['urlFormat' => 'path',

		 'showScriptName' => false,

		 'rules' => [





This behavior happens on every GridView throughout the entire system.

Thank you in advance,

Gasim Gasimzada

Is your controller in a subdirectory or module? if so, try adding this rule here:


'<module:\w+>/<controller:\w+>/<action:\w+>'=>'<module>/<controller>/<action>', // <- that one



Thank you!

I just realized that, adding the module line to the URLs breaks the path look to the query string parameters. I mean, /core/entity/view/id/100 becomes /core/entity/view?id=100. How can I make it path again?

This part of the guide states:

I’m not sure whether you need an extra rule before the existing one or whether you can simply append /* to the end of that one, but you should be able to get it to work with a little experimentation.