Handling redirects with query string parameters
amochohan opened this issue · 1 comments
amochohan commented
Given I have the url: /myendpoint/somepath?parameter1=abc¶meter2=123
, how can I catch this package to redirect to a new endpoint?
I've written this using Laravel's standard routes, with a closure as follows:
Route::get('/myendpoint/somepath', function() {
return Redirect::to('http://someotherdomain.com/anotherendpoint/somethingelse' .
'?parameter1=' . Request::get('parameter1') .
'¶meter2=' . Request::get('parameter2'), 302);
});
freekmurze commented
You can write your own redirector. You can get the url parameters of the $request
method. Not sure but I believe to method to get all parameters is all()
.