I’m trying to redirect users in Drupal 8 as I was used to do in Drupal 7 with a simple drupal_goto()
.
This is my code.
$response = new \Symfony\Component\HttpFoundation\RedirectResponse(\Drupal::url($url_redirect));
$response->send();
Executing it, I get the following error:
Symfony\Component\Routing\Exception\RouteNotFoundException: Route
http://mydomain.es/participar?utm_source=RTB&utm_campaign=&utm_medium=banner&utm_term=1
does not exist.
The alias /participar exists. What am I doing wrong?