I need to rewrite http://example.com:8/?123&x=abc
to http://example.com:8/lorem/ipsus/123/abc
without any redirection.
I've already done this rule :
RewriteCond %{SERVER_PORT} ^8$
RewriteCond %{QUERY_STRING} ^(\d+)&x=(.+)$
RewriteRule ^/?$ lorem/ipsus/%1/%2 [QSD,P]
But Laravel handle the wrong route (/
).
So I've tried to change routes but it seems that Laravel can't handle query string routes :
Route::get('?{key}&x={value}', 'myController@store');
Route::get('{data}', 'myController@store')->where(
[
'data' => '\?\d+&x=.+'
]);
Route::get('lorem/ipsus/{key}/{value}', 'myController@store');
None of them actually work.
This is the laravel .htaccess :
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
And I'm lost... Any help would be appreciated :)