Created
December 4, 2013 04:28
-
-
Save notomato/7782351 to your computer and use it in GitHub Desktop.
Lithium, handling redirects in route config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Permanent redirect of old product URLs. | |
Router::connect('/productdetails/{:id}', [], function($request) { | |
return new lithium\action\Response([ | |
'location' => ['Products::view', 'id' => $request->params['id']], | |
'status' => 301 | |
]); | |
}); | |
// Permanent redirect of old user files | |
Router::connect('/userfiles/{:path}', [], function ($request) { | |
return new lithium\action\Response([ | |
'location' => '/files/' . $request->params['path'], | |
'status' => 301 | |
]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment