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 f8f6bda

Browse filesBrowse files
Added some minor explanation about 308 code
1 parent 8549488 commit f8f6bda
Copy full SHA for f8f6bda

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎routing/redirect_trailing_slash.rst

Copy file name to clipboardExpand all lines: routing/redirect_trailing_slash.rst
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ trailing slash to the same URL without a trailing slash
1010

1111
Create a controller that will match any URL with a trailing slash, remove
1212
the trailing slash (keeping query parameters if any) and redirect to the
13-
new URL with a 308 response status code::
13+
new URL with a 308 (*HTTP Permanent Redirect*) response status code::
1414

1515
// src/AppBundle/Controller/RedirectingController.php
1616
namespace AppBundle\Controller;
@@ -27,6 +27,8 @@ new URL with a 308 response status code::
2727

2828
$url = str_replace($pathInfo, rtrim($pathInfo, ' /'), $requestUri);
2929

30+
// 308 (Permanent Redirect) is similar to 301 (Moved Permanently) except
31+
// that it does not allow changing the request method from POST to GET
3032
return $this->redirect($url, 308);
3133
}
3234
}

0 commit comments

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