I have a url that in the worst case scenario looks like this website.com/clothes/women/type/tshirts/brand/nike/color/red/size/s/price/0-29
This is created by clicking on links that will filter the results starting from website.com/clothes/women. The problem is how can I reverse it ? I show all the filters clicked with a X near it, so when clicked, a certain filter will be deleted and the page refreshes. If I delete the color filter, /color/red or color/red/ must be deleted from the url.
How can this be done ? I tried with str_replace() but with no luck.
Just an input and I will find the way.
Thank you.
?type=tshirts&...?key1/value1/key2/value2/key3/value3...but you're right, it specifically looks like it gets progressively more specific.