Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit6c92c05

Browse files
Reworded the new option explanation
1 parent7210586 commit6c92c05

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
<routeid="admin"path="/wp-admin">
131133
<defaultkey="_controller">Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction</default>
132134
<defaultkey="route">sonata_admin_dashboard</default>
135+
<!-- make a permanent redirection...-->
133136
<defaultkey="permanent">true</default>
137+
<!-- ...and keep the original query string parameters-->
134138
<defaultkey="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)

[8]ページ先頭

©2009-2025 Movatter.jp