htaccess 301 redirect and regular expression problem
I am new here and was advised to join to see if anyone could help.
I need to write a htaccess rule that redirects URLs that follow a certain string, to a new more appropriate URL.
However there is a problem in that the pages i want to redirect also have subpages within them.
e.g. I want to redirect this URL www.example.com/womens/designer-1-all to this URL www.example.com/womens/designer-1
I then will replicate this for all designer pages which is an easy task and a simple rule to write. However on those '-all' pages are options that allow the user to filter products but creates brand new URLs like this:
This problem then replicates across all designer pages and there are too many to do this manually.
How can i use reg ex's to write a rule that says when URL ends in '/tops' or '/bags' and is part of URL folder ending with '-all' then redirect to xxxx page?
Thanks for any help in advance.