Symfony: Forcing redirects in controller and specifying redirect type

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 “

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.


Aaron Belchamber has written 247 articles

Leave a Reply

Your email address will not be published. Required fields are marked *