The Symfony documentation is getting better, but it still lacks more detail, which is why I’ve been collecting helpful tips and snippets here. According to the Symfony docs, by default, the “redirectToRoute()"
method performs a 302 (temporary) redirect, so in order to specify a 301 (permanent) redirect, you can add the third argument in this method within your controller and logic that would trigger a redirect.
public function indexAction()
{
return $this->redirectToRoute('http://www.belchamber.us/page-to-redirect', array(), 301); // 301 is where you can also specify 302
}