Right way to redirect with another code than 301

6 months ago

Jakub Bouček
Member | 38
+
+1
-

From v3.0 is deprecated call $this->reditect(301, 'target'); and is recommended using redirectPermanent() method.

Nette\Application\UI\Component::redirect() first parameter $code is deprecated; use redirectPermanent() for 301 redirect.

Without code is redirect() trying to decide right code.

But I want to send code 307. What is right way to send it?

2 months ago

Felix
Member | 828
+
0
-

You should use $presenter->redirectUrl($url, $code) method.

https://api.nette.org/…ter.php.html#…