Redirect to a view with contextual filters I would like to redirect the user to a view with some contextual filters on the submit of a custom form.

For now I use this : 

$form_state-&gt;setRedirect('view.search.page_1', ['myvalue' =&gt; $value]);


But it add "myvalue" like this : /search?myvalue=$value

and what I want is : /search/$value

Thanks
You have to use the route parameter names defined in the route.

You can check the route definition of this view display with Drupal Console:

drupal router:debug view.search.page_1


When you define contextual filters the route parameter names are usually {arg_0}, {arg_1} ...

So this could work:

$form_state-&gt;setRedirect('view.search.page_1', ['arg_0' =&gt; $value]);