Skip to content

Commit 6c92c05

Browse files
Reworded the new option explanation
1 parent 7210586 commit 6c92c05

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

routing/redirect_in_config.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Redirecting Using a Route
9696

9797
Assume you are migrating your website from WordPress to Symfony, you want to
9898
redirect ``/wp-admin`` to the route ``sonata_admin_dashboard``. You don't know
99-
the path, only the route name, if you pass query parameters to this route and active the ``keepQueryParams``, it will be redirected too. This can be achieved using the
99+
the path, only the route name This can be achieved using the
100100
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController::redirectAction`
101101
action:
102102

@@ -113,7 +113,9 @@ action:
113113
controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction
114114
defaults:
115115
route: sonata_admin_dashboard
116+
# make a permanent redirection...
116117
permanent: true
118+
# ...and keep the original query string parameters
117119
keepQueryParams: true
118120
119121
.. code-block:: xml
@@ -130,7 +132,9 @@ action:
130132
<route id="admin" path="/wp-admin">
131133
<default key="_controller">Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction</default>
132134
<default key="route">sonata_admin_dashboard</default>
135+
<!-- make a permanent redirection... -->
133136
<default key="permanent">true</default>
137+
<!-- ...and keep the original query string parameters -->
134138
<default key="keepQueryParams">true</default>
135139
</route>
136140
</routes>
@@ -147,7 +151,9 @@ action:
147151
$collection->add('admin', new Route('/wp-admin', array(
148152
'_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction',
149153
'route' => 'sonata_admin_dashboard',
154+
// make a permanent redirection...
150155
'permanent' => true,
156+
// ...and keep the original query string parameters
151157
'keepQueryParams' => true,
152158
)));
153159

0 commit comments

Comments
 (0)