File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ If you want to redirect the user to another page, use the ``redirectToRoute()``
132
132
and ``redirect() `` methods::
133
133
134
134
use Symfony\Component\HttpFoundation\RedirectResponse;
135
+ use Symfony\Component\HttpFoundation\Response
135
136
136
137
// ...
137
138
public function index(): RedirectResponse
@@ -142,8 +143,8 @@ and ``redirect()`` methods::
142
143
// redirectToRoute is a shortcut for:
143
144
// return new RedirectResponse($this->generateUrl('homepage'));
144
145
145
- // does a permanent - 301 redirect
146
- return $this->redirectToRoute('homepage', [], 301 );
146
+ // does a permanent HTTP 301 redirect
147
+ return $this->redirectToRoute('homepage', [], Response::HTTP_MOVED_PERMANENTLY );
147
148
148
149
// redirect to a route with parameters
149
150
return $this->redirectToRoute('app_lucky_number', ['max' => 10]);
You can’t perform that action at this time.
0 commit comments