Answer the question
In order to leave comments, you need to log in
How to make a filter without using GET parameters?
Hello.
There is sorting on the site: joxi.ru/D2P81EnspNopE2
and filter joxi.ru/1A5Wj1Ytn8Rnjm
I know
how to do filtering and sorting through GET parameters, but how to do it without them like:
site.ru/catalog/category1/metro1 - category and metro
site. ru/catalog/category10/metro1/male - category, metro and female
site.ru/catalog/category10/metro1/price - category, metro and price sorting
site.ru/catalog/category10/na-dom/male/price - category, home visit, female gender and sorting by price
site.ru/catalog/reviews - just sorting by reviews
, etc.
And does it affect SEO in any way?
Answer the question
In order to leave comments, you need to log in
This will have a positive effect on SEO, but first of all, it will be easier for people, as it is more understandable, tn human-understandable URL.
But only by filters it is better not to reduce, but to display everything.
Well, those in your case:
metro1 - na-dom - This is one parameter different value
site.ru/catalog/category1/metro1 - category and metro
site.ru/catalog/category10/metro1/male - category, metro and female
site. ru/catalog/category10/metro1/any/ - category, metro, any gender
site.ru/catalog/category10/na-dom/male/ - category, home visit, female
site.ru/catalog/?sort_reviews=ASC&sort_price= DESC - just sorting by reviews and price, sorting is still better done separately, through the classic GET. , you can add it any above
In fact, all these urls are GET requests, they are just hidden under the url.
Route::get('/catalog/{category_name?}/{tip_vyezda?}/{sex?}/', '[email protected]')->name('show.Catalog');
/*Где то в FrontController*/
public function showCatalog() {
$category_name = request()->category_name;
//и тд, обработчик проверки и прочее
}
in fact, in laravel this is done natively in routing, and get parameters as such are not used there at all.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question