Route Matching Question

Hi, apologize if this post is duplicate with another topic, however still did not get any answer correctly for my case.

Kong version : Kong Enterprise:

I have URI :

  1. /profile/
  2. /profile/outlet/v2/
  3. /profile/outlet/v3/

for scenario, I would like to pointing route 1 to service A, and route 2 & 3 to service B.
How can we fulfill this scenario? is it possible since route 1 has /profile/ (end with ‘/’ here) ?
I have tried but still the result was route 2 & 3 went to service A.

I’m stuck here in 2 days, hope you guys can help me, thanks in advance…

You can make route 1 as regex route like /profile/$.

With that being said, if these routes have the same matching rules (host, method, sni etc.) route 2 and 3 should match first because they are longer.

Did you use anything else on these route objects?

1 Like

hi @fomm appreciate for your response!
now route 2 & 3 go to service B as it should, after I’m checking on service log…

previously, I configured with /profile/.+, and yeaa apologize me still need to learn more about regex expression.

once again, thankyou for your guidance!!