# Routing two separate services for the same Host with Traefik 2

**URL:** <https://community.traefik.io/t/routing-two-separate-services-for-the-same-host-with-traefik-2/10169>\
**Category:** Traefik v2\
**Tags:** kubernetes-crd\
**Created:** [March 25, 2021, 12:15pm UTC](https://community.traefik.io/t/routing-two-separate-services-for-the-same-host-with-traefik-2/10169 "2021-03-25T12:15:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yassine.laz](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/yassine.laz/32/1987_2.png) [@yassine.laz](https://community.traefik.io/u/yassine.laz)\
**Post date:** [March 25, 2021, 12:15pm UTC](https://community.traefik.io/t/routing-two-separate-services-for-the-same-host-with-traefik-2/10169/1 "2021-03-25T12:15:02Z")

</div>

Hello everyone,

To summarize what I'm trying to achieve with IngressRoute crds:

- I need service A to be accessible from `example.com`
- I need service B to be accessible from `example.com/api`

So far I tried these rules:

- Service A: `Host(example.com)` [with the back ticks of course]
- Service A: `Host(example.com) && PathPrefix(/api/)`

But traffic for /api/ also flows to Service A instead of B.  
I'm curious as if this is something achievable.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![yassine.laz](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/yassine.laz/32/1987_2.png) [@yassine.laz](https://community.traefik.io/u/yassine.laz)\
**Post date:** [March 26, 2021, 12:59pm UTC](https://community.traefik.io/t/routing-two-separate-services-for-the-same-host-with-traefik-2/10169/2 "2021-03-26T12:59:53Z")

</div>

Got it to work..Mods can delete.

---

<div class="post-metadata">

**Author:** ![rgstephens](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/rgstephens/32/4111_2.png) [@rgstephens](https://community.traefik.io/u/rgstephens)\
**Post date:** [August 15, 2021, 5:07am UTC](https://community.traefik.io/t/routing-two-separate-services-for-the-same-host-with-traefik-2/10169/3 "2021-08-15T05:07:57Z")

</div>

> Mods can delete.

What are you referring? Can you provide an example of the config that worked for you?

---

<div class="post-metadata">

**Author:** ![muddro1](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/muddro1/32/4113_2.png) [@muddro1](https://community.traefik.io/u/muddro1)\
**Post date:** [August 16, 2021, 12:00am UTC](https://community.traefik.io/t/routing-two-separate-services-for-the-same-host-with-traefik-2/10169/4 "2021-08-16T00:00:00Z")

</div>

How'd you resolve? Have same issue.
