@@ -7,8 +7,8 @@ How to configure a redirect to another route without a custom controller
7
7
This guide explains how to configure a redirect from one route to another
8
8
without using a custom controller.
9
9
10
- Let's assume that there is no useful default controller for the ``/ `` path of
11
- your application and you want to redirect theses requests to ``/app ``.
10
+ Assume that there is no useful default controller for the ``/ `` path of
11
+ your application and you want to redirect these requests to ``/app ``.
12
12
13
13
Your configuration will look like this:
14
14
@@ -26,15 +26,15 @@ Your configuration will look like this:
26
26
path : /app
27
27
permanent : true
28
28
29
- Your ``AppBundle `` is registered to handle all requests under ``/app ``.
30
-
31
- You configure a route for the ``/ `` path and let :class: `Symfony\\ Bundle\\ FrameworkBundle\\ Controller\\ RedirectController `
32
- handle it. This controller is built-in and offers two methods for redirecting request:
33
-
34
- * ``redirect `` redirects to another *route *. You must provide the ``route ``
35
- parameter with the *name * of the route you want to redirect to.
29
+ In this example, you configure a route for the ``/ `` path and let :class: `Symfony\\ Bundle\\ FrameworkBundle\\ Controller\\ RedirectController `
30
+ handle it. This controller comes standard with Symfony and offers two actions
31
+ for redirecting request:
36
32
37
33
* ``urlRedirect `` redirects to another *path *. You must provide the ``path ``
38
34
parameter containing the path of the resource you want to redirect to.
39
35
40
- The ``permanent `` switch tells both methods to issue a 301 HTTP status code.
36
+ * ``redirect `` (not shown here) redirects to another *route *. You must provide the ``route ``
37
+ parameter with the *name * of the route you want to redirect to.
38
+
39
+ The ``permanent `` switch tells both methods to issue a 301 HTTP status code
40
+ instead of the default ``302 `` status code.
0 commit comments