Skip to content

Commit f8f6bda

Browse files
Added some minor explanation about 308 code
1 parent 8549488 commit f8f6bda

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

routing/redirect_trailing_slash.rst

Lines 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)