Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 29c2bec

Browse filesBrowse files
committed
Tweak
1 parent c1d1df6 commit 29c2bec
Copy full SHA for 29c2bec

File tree

Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed

‎controller.rst

Copy file name to clipboardExpand all lines: controller.rst
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ and ``redirect()`` methods::
144144
// return new RedirectResponse($this->generateUrl('homepage'));
145145

146146
// does a permanent HTTP 301 redirect
147+
return $this->redirectToRoute('homepage', [], 301);
148+
// if you prefer, you can use PHP constants instead of hardcoded numbers
147149
return $this->redirectToRoute('homepage', [], Response::HTTP_MOVED_PERMANENTLY);
148150

149151
// redirect to a route with parameters

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.