Redirect to view display after form submission I'm using a form_alter hook to add a custom submit callback. I want to redirect the user to a particular page display of a view. However, I'm having trouble figuring out how to specify the path. 

In my custom submit hook, I tried $form_state-&gt;setRedirect('/my-view/page/path'); but that didn't work. From searching, I found this question, Redirect after form submission, but the answers indicate to specify the machine name of a path from a routing yaml file. 

I'm wanting to redirect the user to a views page display that I built in the UI, so I don't have any routing.yml file (that I'm aware of) where I could glean a machine name of a path from. 

How do I set the redirect in a custom submit handler to a page display of a view?
Routes are not only defined in yaml files, but also dynamically in route subscribers.

Drupal\views\EventSubscriber\RouteSubscriber collects routes from all views displays which implement DisplayRouterInterface::collectRoutes, like the Page display:

PathPluginBase::collectRoutes:

  public function collectRoutes(RouteCollection $collection) {
    $view_id = $this-&gt;view-&gt;storage-&gt;id();
    $display_id = $this-&gt;display['id'];

    $route = $this-&gt;getRoute($view_id, $display_id);

    if (!($route_name = $this-&gt;getOption('route_name'))) {
      $route_name = "view.$view_id.$display_id";
    }
    $collection-&gt;add($route_name, $route);
    return ["$view_id.$display_id" =&gt; $route_name];
  }


This produces route names like view.my_view.page_1 and you can redirect in a form submit:

$form_state-&gt;setRedirect('view.my_view.page_1');