Redirect users to some page when submitting a form

When submitting a form you might want to redirect users to some page, there are few ways you can do that, they are listed below. You will put this into your submit handler function

// Redirect to an internal Drupal route.
$form_state->setRedirect('mymodule.page');
// Or
$form_state->setRedirect(
  'entity.node.canonical',
  ['node' => $node->id()]
);

// Redirect to a URI, or other web address
$url = Drupal\core\Url::fromUserInput('/some_page');
$form_state->setRedirectUrl($url);

// Redirect with params and options
$route_name = 'view.membership.membership';
$params = ['user' => $uid];
$options = [];
$form_state->setRedirect($route_name, $params, $options);