Hi @ahd , I understand you're asking about pattern matching for Application Gateway rewrite rule. You want to rewrite the path with pattern "/api/anycharacterafterit" to "/qa/api/anycharacterafterit".
Application Gateway uses regular expressions for pattern matching. You should use Regular Expression 2 (RE2) compatible expressions when writing your pattern matching syntax.
I think this will achieve what you're trying to do:
- If
- Type of variable to check:
Server variable - Server variable:
uri_path - Operator:
equal (=) - Pattern to match:
/api/(.*)
- Type of variable to check:
- Then
- Rewrite type:
URL - Action type:
Set - Components:
URL path - URL path value:
/qa/api/{var_uri_path_1}
- Rewrite type:
For more information, see Pattern matching and capturing.
Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.