Redirect from one module to another I have form in one module.

  public static function validateForm(array &amp;$form, FormStateInterface $form_state) {
      $url = \Drupal\Core\Url::fromRoute('test.route');
      $form_state-&gt;setRedirectUrl($url);
      $form_state-&gt;setRedirect('test.route');
  }


Trying to redirect the route of another module.

It's not redirecting from one module to another.
An example

    use Drupal\Core\Url;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;


Its not working in Form validate.

Its working un submitform

public function submitForm(array &amp;$form, FormStateInterface $form_state) {
    $url = Url::fromRoute('route.path');
        $form_state-&gt;setRedirectUrl($url);
}