I have a url like domain.com/category/
Somehow, Google has picked up domain.com/category/category/ which ends up somewhere else.
the “category” for the rule I would like to create will always be the same, so what I would like to do is find our if this matches and then strip either one.
The url will then go to the right place.
i.e. domain.com/category/category/ should end up like domain.com/category/ if /category/ matches the second /category/
Is this possible with a simple condition?
Yes, possible with simple condition using the
\1backreference:Or you can just do it all in the rule: