What you need to do is reconstruct the URL with extracted data without appending, so your match pattern could be:
Which will give you the following grouping:
We only need group 4 (you may want to refer back to Tyk for this key, or just log it), and your rewrite can then be:
The idea here is you just replace things completely with paameterised groups
Let me know if that helps.