I am working on a website that lists products. There is also a filter. Now comes the problem. We had to change the filter feature and it is now creating slightly different urls and we need to create some 301 redirects based on the query string parameters The tricky thing is that the parameters can be in any order and also not all may be present at any time. So for example we might have the following query strings ?filter_brand=7882&filter_gender=7888 ?filter_gender=7888&filter_brand=7882 ?filter_gender=7888&filter_range=5746&filter_brand=7882 All we need to do is change the filter to attro and add an additional paramenter I googled loads and couldn't find anything so hoping that someone here can help? Thanks,
Here is one of my attempts using this query string ?filter_brand=7882&filter_gender=7888 RewriteCond %{QUERY_STRING} filter_gender=([0-9]*) [NC] RewriteCond %{QUERY_STRING} filter_brand=([0-9]*) RewriteRule (.*) /store/?cnpf=1&attro_brand=%2&attro_gender=%1 [R=301,L] Code (markup): It redirects to ?cnpf=1&attro_brand=&attro_gender=7882 assigning the brand id to gender and missing the gender id completely. Where am I going wrong