How to make redirection to the home page if there are some params in the url?

Viewed 39

Sorry for my english in advance. On my home page I have posts and posts filter (select menu, checkbox, some inputs and etc). Each parameter is reflected in the url but I can't share it (I'll get the 404 error in return). I didn't want to use get-parameters in the url, so now it looks like:

<...home>/sortby-date/order-desc/privateOnly-true

How do I redirect to the home page if it's "/" or the words, for example, "sortby" and "order" are in the url otherwise it will redirect to the 404 page. Thank you!

0 Answers
Related