Request: get a specific segment of URL related to Language and add it as a query string, plus stripping of first 2 segments of the incoming URL:
Group 1: first part of the URL to be maintained Group 2: language (which becomes QS) Group 3: second part of the URL to be maintained Group 4: Question mark "?" which needs to be removed Group 5: Query strings which needs to be maintained
Example: /cms/api/preview/pippo/paperino/en-US/pluto/DePaperoni/paperoga?qui=qua&quo=qui&cap-paperopoli=123
Transformation: /preview/$1/$3?lang=$2&$5
Output: /preview/pippo/paperino/pluto/DePaperoni/paperoga?lang=en-US&qui=qua&quo=qui&cap-paperopoli=123