# Questions about the principle of routes matching

**URL:** <https://discuss.konghq.com/t/questions-about-the-principle-of-routes-matching/8078>\
**Category:** Questions\
**Created:** [March 22, 2021, 5:33pm UTC](https://discuss.konghq.com/t/questions-about-the-principle-of-routes-matching/8078 "2021-03-22T17:33:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaunceyWang](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/chaunceywang/32/2653_2.png) [@chaunceyWang](https://discuss.konghq.com/u/chaunceyWang)\
**Post date:** [March 22, 2021, 5:33pm UTC](https://discuss.konghq.com/t/questions-about-the-principle-of-routes-matching/8078/1 "2021-03-22T17:33:00Z")

</div>

Hi everyone~

I need to apply the login authentication plug-in to the specified api path.

For example,

- if there is a Route named **‘Route1’** and it’s path is `'/api/phone'`,

- I want to apply the authentication plug-in to all requests under the path of` '/api/phone/sell'`.  
So I built a Route named **‘Route2’** with path:`'/api/phone/sell'`.

But when I actually called it, it was different from what I expected.

When my request path is` '/api/phone/sell'`, the matched Route is **‘Route1’**. Only when my request path is `'/api/phone/sell/abc'` can I match **‘Route2’**.

This has caused me confusion, because I recently upgraded my version of kong from `0.14.x` to `1.3.x`, and there was no such problem in the previous version. Is it because I don’t understand the path matching principle correctly, or is there some adjustments in Kong after a certain version?

All help appreciated 🙂

---

<div class="post-metadata">

**Author:** ![chaunceyWang](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/chaunceywang/32/2653_2.png) [@chaunceyWang](https://discuss.konghq.com/u/chaunceyWang)\
**Post date:** [March 23, 2021, 2:40am UTC](https://discuss.konghq.com/t/questions-about-the-principle-of-routes-matching/8078/2 "2021-03-23T02:40:36Z")

</div>

I know that you can match all requests under the sell path by writing the regular expression `/api/phone/sell[\s\S]*$`, but shouldn’t this be the default operation?

---

<div class="post-metadata">

**Author:** ![chaunceyWang](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/chaunceywang/32/2653_2.png) [@chaunceyWang](https://discuss.konghq.com/u/chaunceyWang)\
**Post date:** [March 29, 2021, 1:56am UTC](https://discuss.konghq.com/t/questions-about-the-principle-of-routes-matching/8078/3 "2021-03-29T01:56:18Z")

</div>

This problem has not been solved yet, can anyone give some suggestions?🙂

---

<div class="post-metadata">

**Author:** ![chaunceyWang](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/chaunceywang/32/2653_2.png) [@chaunceyWang](https://discuss.konghq.com/u/chaunceyWang)\
**Post date:** [April 8, 2021, 12:39pm UTC](https://discuss.konghq.com/t/questions-about-the-principle-of-routes-matching/8078/4 "2021-04-08T12:39:04Z")

</div>

I am still waiting for a reply 🤔
