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: language (which becomes QS) Group 2: second part of the URL to be maintained Group 3: empty Group 4: Fragment Group 5: Question Mark to be removed Group 6: Query strings which needs to be maintained
Example: /en-US/cms/api/preview/pippo/paperino/pluto/DePaperoni/paperoga/#user=Artibani?qui=qua&quo=qui&cap-paperopoli=123
Transformation: /preview/$2?lang=$1&$4
Output: /preview/pippo/paperino/pluto/DePaperoni/paperoga/#user=Artibani?lang=en-US&qui=qua&quo=qui&cap-paperopoli=123