I have the following route for a controller:
/**
* @Route("/fail/{uid}", name="bookFail", defaults={"uid"=0})
*/
From another controller, I redirect like this:
return $this->redirect($this->generateUrl('bookFail', array('id' => $jobExists->getId())), 301);
Which leads to this:
/hvz/web/app_dev.php/fail?id=XXX
but should be this:
/hvz/web/app_dev.php/fail/XXX
My current solution is this:
$this->redirect(str_replace('?id=','/',$this->generateUrl('bookFail', array('id' => $jobExists->getId()))), 301);
which works but feels wrong on so many levels, what would be the "right" solution for that?