Page redirect after form submit on drupal 8

  1. Find the route name and variable of the page that you want to do redirection on "modules/yourModule/yourModule.routing.yml"
    User.routename://<--route name
    path: 'your_page/{var1}/{var2}'//<--variables
       _controller: '\Drupal\yourModule\Controller\pageController::getPage'
       _title: 'My next page'
  2. Add this script on the function submitForm.
    public function submitForm(array &$form, FormStateInterface $form_state) {
         $url = \Drupal\Core\Url::fromRoute('User.routename',['var1'=>'value1','var2'=>'value2']); 
         $form_state->setRebuild(false); //* If the rebuild variable is enabled, the page redirect will not be work.