mercredi 28 mars 2018

Laravel 5 generating search query SEO friendly url

I have a laravel 5 website with the following search query url format:

mywebsite.com/s?location=Italy

and i want to achieve this SEO friendly url format:

mywebsite.com/s/location/Italy

And this is in my routes.php:

Route::get('s', 'SearchController@index'); Route::match(['get', 'post'], 'searchResult', 'SearchController@searchResult');

Route::get('s/{id}', 'SearchController@index')->where('id', '[0-9]+');

Any suggestion would be awesome. Thank you!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire